I am trying to use Windows Core API to register for notifications on audio device changes.
I am able to create a IMMDeviceEnumerator.
DeviceEnum := CreateComObject(CLASS_IMMDeviceEnumerator) as IMMDeviceEnumerator;
As the next step, I need to use
RegisterEndpointNotificationCallback to register for notifications. I am assuming I have to do something like, but I might be wrong.
OleCheck(DeviceEnum.RegisterEndpointNotificationCallback(IMMNotificationClient(@NotificationClient)));
However, I do not know how to instantiate IMMNotificationClient.
1. If I have to use
CreateComObject , I do not know the CLSID. I have gone through header files in Mingw, but I could not find the CLSID.
2. In certain C projects, they mock a C++ (COM) object starting with a struct and then by adding appropriate methods.
Please advise...