HRESULT RegisterActiveObject(IUnknown *pIUnknown, GUID *RefIId, DWORD Options, DWORD *Identifiant);
En retour, l'identifiant de l'objet est placé dans Identifiant.
#include <windows.h>
#include <winbase.h>
#include <ole2.h>
IUnknown *pIUnknown;
GUID Guid;
DWORD Identifiant;
...
Identifiant=0;
if (RegisterActiveObject(pIUnknown, &Guid, ACTIVEOBJECT_STRONG, &Identifiant)!=S_OK)
{
...
}
...
if (RevokeActiveObject(Identifiant, NULL)!=S_OK)
{
...
}
...