SENS and subscription
Creating of subscription finishes without errors,
but when I unplug network cable, plug it back and establish connection,
nothing is notified, No function of ISensNetwork which are implemented in my
subscriber are called. What can be reason ?
This is part of code in my MyProjNameModule::Run() which I experiment with:
hr = S_OK;
IEventSystemPtr evSystem;
hr = evSystem.CreateInstance(L"{4E14FBA2-2E22-11D1-9964-00C04FBBB345}");
IEventSubscriptionPtr evSub;
hr = evSub.CreateInstance(L"{7542E960-79C7-11D1-88F9-0080C7D771BF}");
hr = evSub->put_SubscriptionID(L"{05F3AC69-7104-4798-A468-A87431DE2407}");
hr = evSub->put_SubscriptionName(L"MySubscription");
hr = evSub->put_methodName(L"ChangedSubscription");
IUnknown *unk = NULL;
hr = pMyClass->QueryInterface(IID_IUnknown, (void**)&unk);
hr = evSub->put_SubscriberInterface(unk);
hr =
evSub->put_EventClassID(L"{B8881EBE-7058-4BB0-8974-38E9D399B7F2}");/*coclass
ID of my subscriber from *.idl file */
hr = evSub->QueryInterface(IID_IUnknown, (void**)&unk);
hr = evSystem->Store(L"EventSystem.EventSubscription", unk);
Sleep(INFINITE);