This function allows you to register your server in the OLE system registry.
BOOL AFXAPI AfxOleRegisterServerClass( REFCLSID clsid, LPCTSTR lpszClassName, LPCTSTR lpszShortTypeName, LPCTSTR lpszLongTypeName, OLE_APPTYPE nAppType = OAT_SERVER, LPCTSTR* rglpszRegister = NULL, LPCTSTR* rglpszOverwrite = NULL );
- Reference to the server's OLE class ID.
- Pointer to a string containing the class name of the server's objects.
- Pointer to a string containing the short name of the server's object type, such as "Chart."
- Pointer to a string containing the long name of the server's object type, such as "Microsoft Excel 5.0 Chart."
- A value, taken from the OLE_APPTYPE enumeration, specifying the type of OLE application. Possible values are the following:
- OAT_INPLACE_SERVER Server has full server user-interface.
- OAT_SERVER Server supports only embedding.
- OAT_CONTAINER Container supports links to embeddings.
- OAT_DISPATCH_OBJECT IDispatch-capable object.
- Array of pointers to strings representing the keys and values to be added to the OLE system registry if no existing values for the keys are found.
- Array of pointers to strings representing the keys and values to be added to the OLE system registry if the registry contains existing values for the given keys.
Nonzero if the server class is successfully registered; otherwise 0.
Most applications can use COleTemplateServer::Register to register the application's document types. If your application's system-registry format does not fit the typical pattern, you can use AfxOleRegisterServerClass for more control.
The registry consists of a set of keys and values. The rglpszRegister and rglpszOverwrite arguments are arrays of pointers to strings, each consisting of a key and a value separated by a NULL character (
'\0'). Each of these strings can have replaceable parameters whose places are marked by the character sequences
The symbols are filled in as follows:
|%1||Class ID, formatted as a string|
|%3||Path to executable file|
|%4||Short type name|
|%5||Long type name|