For your COM server to be fully functional, all components and their respective interfaces must be registered with the system. In addition, the type library must also be registered so that it can be used to implement IDispatch for your components.
The registry entries are typically created during installation of your software. Your COM server must register the following information:
Below you will find information to help create a registry (REG) file, which identifies the minimum amount of information required for your COM server. REG files are useful for creating registry entries from install scripts.
Here is the general format, using compoly.reg as an example:
REGEDIT
; type library entries
HKEY_CLASSES_ROOT\TypeLib\{uuid of type library}
HKEY_CLASSES_ROOT\TypeLib\{uuid of type library}\1.0 =
compoly 1.0 Type Library HKEY_CLASSES_ROOT\TypeLib\
{uuid of type library}\1.0\HELPDIR = x:\some\path\to
HKEY_CLASSES_ROOT\TypeLib\{uuid of type library}\1.0\0\win32 =
x:\some\path\to\compoly.tlb
HKEY_CLASSES_ROOT\TypeLib\{uuid of type library}\1.0\9\win32 =
x:\some\path\to\compoly.tlb
; coclass entries
HKEY_CLASSES_ROOT\CLSID\{uuid of coclass} = ComPolygon Class
HKEY_CLASSES_ROOT\CLSID\{uuid of coclass}\InProcServer32 =
x:\some\path\to\compoly.dll
; interface entries
HKEY_CLASSES_ROOT\Interface\{uuid of interface} =
IComPolygon Interface
HKEY_CLASSES_ROOT\Interface\{uuid of interface}\TypeLib =
{uuid of type library}
HKEY_CLASSES_ROOT\Interface\{uuid of interface}\ProxyStubClsid32 =
{00020424-0000-0000-C000-000000000046}
; AcRxClass name
HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\ObjectDBX\R24.1\ActiveXCLSID
\AsdkPoly = {uuid of coclass}
You repeat the coclass and interface sections for every coclass and interface in your type library. The IDL file used to build the type library will contain all the uuids you need to fill in the blanks above. Following are commented excerpts from compoly.idl that identify each uuid.
[ // uuid of type lib. // uuid(45C7F028-CD9A-11D1-A2BD-080009DC639A), version(1.0), helpstring("compoly 1.0 Type Library") ] library COMPOLYLib { // ... Code cut out for brevity. // IComPolygon interface [ object, // uuid of interface // uuid(45C7F035-CD9A-11D1-A2BD-080009DC639A), dual, helpstring("IComPolygon Interface"), pointer_default(unique) ] interface IComPolygon : IAcadEntity { // ... Code cut out for brevity. }; // ... Code cut out for brevity. // ComPolygon coclass [ // uuid of coclass // uuid(45C7F036-CD9A-11D1-A2BD-080009DC639A), helpstring("ComPolygon Class"), noncreatable ] coclass ComPolygon { [default] interface IComPolygon; [source] interface IAcadObjectEvents; }; };
For a project-specific example of a REG file, see Building and Registering a COM DLL.