Next Previous Up Top Contents Index

3.4 Building a compound document server in DUIM

3.4.3 Registering server applications with Windows

Before your application can be embedded in a container, it must first be registered with the Windows operating system as an OLE server. Once you have done this, container applications can use your application as a server.

The typical way to register a server application is to invoke it from the MS-DOS command line, passing the argument /RegServer. The application recognizes the registration request, creates the necessary entries in the Windows registry, and then exits (without displaying any window). You can revoke the registration -- that is, remove the registry entries -- by running the application again with the option /UnregServer. If you do not specify either argument, the application runs normally.

The DUIM-OLE-Server library takes care of these registration tasks within the normal DUIM programming context. You do not have to write any code for interpreting the command-line arguments. Instead, when you call start-frame on your instance of <embeddable-frame>, the selected method checks whether you passed /RegServer was passed. If you did, the start-frame method registers your server application and then exits the application.

For example:

ms-dos> my-server-app.exe /RegServer

Note: The full pathname of the executable file is recorded in the registry. If you move the file to different folder afterwards, you must register it again.


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

Next Previous Up Top Contents Index