Register COM implementation

I am new to COM programming. I have a COM object (and the associated IClassFactory) everything is ready to work, but I can’t understand how to register the resulting DLL for use by other programs. I also miss the number of GUIDs that I need to scroll.

The COM object I'm trying to register implements the IAudioSessionEvents interface.

I came across the DllRegisterServer and DllUnregisterServer functions, but I did not find clear demonstrations of their use. What keys do they deal with, how are they called, what and when, etc.?

Thanks,
Kevin Montrose

+2
source share
3 answers

, DLL, IAudioSessionEvents. DLL, , regsvr32 . :

regsvr32

:

regsvr32/u

regsvr32 , .

DLL, DllRegisterServer DllUnRegisterServer. . - ProgID, CLSID , . , IAudioSessionEvent. DLL, .

: regsvr32 .

, , , ATL, . , , COM .

+3

GUID , COM GUID , COM.

DllRegisterServer/DllUnregister , regsvr32 ( Windows) , COM. / HKCR/CLSID , COM. CoCreateInstance(), , DLL GUID.

ATL - DllRegisterServer/DllUnRegisterServer, , .

+2

Quite often, the easiest way to implement self-registration is to use the ATL server classes, have a global variable that comes from CComModule (or another similar class) and define COM_MAP in your module. Then you request the com module to handle registration based on the .rgs files that you added to your project.

0
source

Source: https://habr.com/ru/post/1705900/


All Articles