Wrong vtable for COM interfaces that don't inherit IUnknown

KytoDragon kytodragon at e.mail.de
Mon Jul 15 22:01:25 UTC 2019


I am currently trying to write a XAudio2 backend and have come 
across the problem, that some of the interfaces for XAudio2's COM 
objects seem to be missing the first entry in their vtable. After 
reading the iterface article in the spec 
(https://dlang.org/spec/interface.html#com-interfaces) it seems 
that only interfaces inheriting from 
core.stdc.windows.com.IUnknown (or any interface named 
"IUnknown") get the COM interface layout instead of the D layout.

What can I do to get the COM layout on interfaces that don't 
inherit IUnknown?
Examples: IXAudio2Voice or any of the IXAudio2*Callback 
interfaces. I have already declared everything extern(Windows), 
but that does not fix it.


More information about the Digitalmars-d-learn mailing list