COM objects and instance creation in Lispworks
"david (as david at bundgaard dot se)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <1762295147289.7.29646@webmail-backend-production-669b86b749-gctgq> |
Hello all,
I am fairly new to Lispworks.
I am trying to grok the COM library.
In this case, I want to build an audio session monitoring for Windows, which to requires me to implement the IAudioSessionNotification in Lisp.
The interface is fairly simple
MIDL_INTERFACE("641DD20B-4D41-49CC-ABA3-174B9477BB08")
IAudioSessionNotification : publicIUnknown
{
public: virtualHRESULT STDMETHODCALLTYPE OnSessionCreated(/* [in] */IAudioSessionControl *NewSession) = 0;
};
To get access to use this event, I need to instantiate IMMDeviceEnumerator, from there we go get the GetDefaultEndpoint(eRender, eConsole, &device).
Then we do some more magic, the process is the same, and we end up with an IAudioSessionManager, with which we can register our callback class (IAudioSessionNotification).Do I need to replicate all the methods and types to be able to call the various methods on each COM class?
I started by creating a .idl file, that would mirror the IAudioSessionNotification and IAudioSessionControl. I assume I should continue creating all the types (IMMDeviceEnumerator, IMMDevice, IAudioSessionEnumerator, etc), should I also implement their interfaces (define-com-implementation).
All the best
David