Torna al Thread
COMAdminCatalogClass ^comAdmin = gcnew COMAdminCatalogClass();
ICatalogCollection ^subCollection = (ICatalogCollection ^)comAdmin->GetCollection("TransientSubscriptions");
subCollection->Populate();
ICatalogObject ^catalogObject = (ICatalogObject ^)subCollection->Add();
// we must insert the CLSID of our component, we can see in the
// Component Services Tool or in the registry editor
catalogObject->Value["EventCLSID"] = "{D5978620-5B9F-11D1-8DD2-00AA004ABD5E}";
catalogObject->Value["Name"] = "Subscription to Logon event";
catalogObject->Value["MethodName"] = "Logon";
// who subscribe the event
catalogObject->Value["SubscriberInterface"] = this;
catalogObject->Value["Enabled"] = true;
catalogObject->Value["PerUser"] = true;
subCollection->SaveChanges();