Next Previous Up Top Contents Index

6.7.4 Self-registration for local server applications

OLE-util-register-only?

Function

Summary

Returns #t if a local server application has been invoked with command-line arguments specifying that it only register or unregister itself, rather than run normally; and #f otherwise.

Signature

OLE-util-register-only? () => register? 

Arguments

None.

Values

register?
An instance of <boolean>.

Library

OLE-Server

Module

OLE-Server

Description

Returns #t if the application has been invoked with command-line arguments specifying only that it register or unregister itself, rather than run normally; and #f otherwise.

The function will return #t when the application's first command-line argument is any of /RegServer, -RegServer, /UnregServer or -UnregServer. The comparison of the actual command-line arguments with these strings is not case-sensitive.

Only local server applications should call this function; it is meaningless to call it in an in-process server application, since they cannot be invoked as stand-alone applications with command-line arguments.

If the result of calling this function is #t, the local server application should simply call register-ole-server and terminate without doing anything else. That function will register or unregister the application as the command-line arguments require.

Example

  if (OLE-util-register-only?()) // just [un]register &
                                 // terminate
   register-ole-server(class-id, prog-id, title-string, 
                       short-name: short-name-string);
  else // actually run the program
  ...
  end if;

OLE, COM, ActiveX and DBMS Reference - 31 MAR 2000

Next Previous Up Top Contents Index