Wrong vtable for COM interfaces that don't inherit IUnknown

rikki cattermole rikki at cattermole.co.nz
Sun Jul 21 07:04:00 UTC 2019


On 21/07/2019 5:44 PM, Kagamin wrote:
> On Tuesday, 16 July 2019 at 01:38:49 UTC, evilrat wrote:
>> Also from what I see MS done this intentionally, means they either no 
>> longer loves COM or there was some other good reason.
> 
> Primary consumer of COM interfaces is Visual Basic. It was really only 
> Bill Gates who loved Basic, he wrote a Basic interpreter in 1975 and 
> created Microsoft as a business that sold Basic interpreters. As gamedev 
> was locked in C++, there was no real use case for COM there, so MS 
> probably does the expected thing and goes with straight C++.

I suspect both of you are wrong in this regard.

"No other XAudio2 objects are reference-counted; their lifetimes are 
explicitly controlled using create and destroy calls, and are bounded by 
the lifetime of the XAudio2 object that owns them."

https://docs.microsoft.com/en-us/windows/win32/api/xaudio2/nn-xaudio2-ixaudio2

COM is used heavily in WinAPI since about Vista. Pretty much all new 
functionality has been exposed by it and NOT extern(Windows) functions 
which was the standard during up to about XP (for example notification 
icons would today be COM based but isn't).

E.g. jump lists 
https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-icustomdestinationlist

Windows isn't the only one with a solution like COM.
Linux has D-Bus which underpins most newer Desktop Environments.
You can do everything from shutdown, log out and even send notification 
messages via it.


More information about the Digitalmars-d-learn mailing list