OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Step 2: Deriving the application class from TOcModule

The application object of an ObjectComponents program needs to derive from TOcModule as well as owl::TApplication.

TOcModule coordinates some basic housekeeping chores related to registration and memory management. It also connects your application to OLE. More specifically, TOcModule manages the connector object that implements COM interfaces on behalf of an application. If the declaration of your application object looks like this:

class TMyApp : public TApplication {
public:
TMyApp() :
TApplication(){};
.
.
.
};

Then change it to look like this:

class TMyApp : public TApplication, public TOcModule {
public:
TMyApp():
TApplication(::AppReg["appname"], ::Module, &::AppDictionary){};
.
.
.
};

The constructor for the revised TMyApp class takes three parameters.

A string naming the applicationAppReg is the application's registration table. The expression ::AppReg["appname"] extracts a string that was registered to describe the application.
A pointer to the application module.Module is a global variable of type TModule* defined by ObjectWindows.
The address of the application dictionary.AppDictionary is the application dictionary object.