Next Previous Up Top Contents Index

6.7.4 Self-registration for local server applications

register-ole-server

Function

Summary

Depending on the command-line arguments passed to the application, this function creates or deletes the Windows 95 and Windows NT system registry entries necessary for the current application to be used as a server for an embeddable OLE object.

Signature

register-ole-server class-id prog-id title-string 
                    #key full-name short-name app-name 
                         misc-status verbs => ()

Arguments

class-id
The COM Class ID that identifies the object the server provides. Required.

This ID can be represented either as a string of 32 hexadecimal digits in the following format

"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"

That is, where each x is a hexadecimal digit. For example:

"{e90f09e0-43db-11d0-8a04-02070119f639}"

Alternatively, the ID can be an instance of <REFCLSID>, as returned from make-GUID.

prog-id
An instance of <string>. Required.

title-string
An instance of <string>. Required.

full-name
An instance of <string>. Default value: the value of short-name.

short-name
An instance of <string>. Default value: the value of app-name.

app-name
An instance of <string>. Default value: the value of title-string.

misc-status
An instance of <integer>.

verbs
An instance of <vector>. Default value: see Description.

Values

None.

Library

OLE-Server

Module

OLE-Server

Description

Creates the Windows 95 and Windows NT system registry entries necessary for the current application to be used as a server for an embeddable OLE object. But if the application was invoked with /UnregServer or -UnregServer, this function will try to delete any registry entries that belong to the application.

The class-id argument must have the same value as passed with the clsid: init-keyword to make on <class-factory>.

The prog-id argument is a unique internal string name for the class. It must begin with a letter. It cannot contain any spaces or punctuation except a period (.) character, and it must not be more than 39 characters long. In order to ensure uniqueness, the recommended format is:

  vendor-name.product-name.version-number 

For example:

  AcmeWidgets.FrobMaster.2

The title-string argument appears in a container's Insert Object dialog box to identify the kind of object this server application provides.

The full-name keyword argument is the full type name of the class. Its default value is the value of the short-name keyword.

The short-name keyword argument is used for popup menus and the Links dialog box. It must be a string of not more than 15 characters in length. Its default value is the value of the app-name keyword.

The app-name keyword argument is the name of the application servicing the class, and is used in the Result text in dialog boxes. Its default value is the value of the required title-string argument.

The misc-status keyword argument specifies the value to be returned by IOleObject::GetMiscStatus. The value is formed by using logior to combine $OLEMISC-... constants. Default value: 0.

The verbs keyword argument specifies the verbs and menu entries that the object supports. The value is a vector, with each element representing the attributes of one verb. Default value:

  vector(vector(0, "&Edit",  // in-place activation
                $MF-ENABLED, 
                $OLEVERBATTRIB-ONCONTAINERMENU),
         vector(1, "&Open",  // out-of-place activation
                $MF-ENABLED, 
                $OLEVERBATTRIB-ONCONTAINERMENU))

This value produces the following registry entries:

  HKEY_CLASSES_ROOT\CLSID\{...}\Verb\0 = &Edit,0,2
  HKEY_CLASSES_ROOT\CLSID\{...}\Verb\1 = &Open,0,2

Alternatively, you can register a server with:

  // check for "/RegServer" or "/UnregServer"
  if (~OLE-util-maybe-just-register(class-id, 
                                    prog-id, 
                                    title-string, 
                                   short-name: name))
  // now run the application
  ...
  end if;

Here, the OLE-util-maybe-just-register function has the same arguments as register-ole-server. It either unregisters the server application and returns #t, or does nothing and returns #f.


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

Next Previous Up Top Contents Index