I have some C++ code that sets up a sink for registering IMbnDeviceServicesEvents notifications as described here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh780515.aspx
The following procedure describes how to register for notifications.
- Get an
IConnectionPoint interface by calling
QueryInterface on an
IMbnDeviceServicesManager object.
- Call
FindConnectionPoint on the returned interface and pass IID_IMbnDeviceServicesEvents to RIID.
- Call
Advise on the returned connection point and pass a pointer to an
IUnknown interface on an object that implements
IMbnDeviceServicesEvents to PUNK.
The code works fine on Win8 x86 with desktop app, but none of the notifications (e.g. OnOpenCommandSessionComplete) are called for the metro app. I was unable to get ::CoInitializeEx( 0,
COINIT_MULTITHREADED ) to work for the metro app, until I created a create_async function and had everything
called from there. However, it still fails. Any ideas/sample code on how to do this from C++?
Thanks.