core.sys.windows.com.ComObject apparently has wrongly laid out Vtable

Carl Sturtivant sturtivant at gmail.com
Sat Mar 23 19:28:09 UTC 2024


On Thursday, 21 March 2024 at 16:10:25 UTC, Walter Bright wrote:
> On 3/21/2024 7:30 AM, Carl Sturtivant wrote:
>> Can we get those benefits out here without 
>> `core.sys.windows.unknwn.IUnknown` by definining a class 
>> extern(C++) to get a COM compatible vtbl[] and then qualifying 
>> each of its methods as extern(Windows) to get COM compatible 
>> calling, and writing our methods in the correct COM order, 
>> starting with QueryInterface, AddRef, Release, and relying on 
>> D to place the methods in the vtbl[] in that order?
>
> No, because the vtbl[] layout is different.

I don't agree: this works in a proof of concept compiled at both 
32 and 64 bits. Details below.


More information about the Digitalmars-d mailing list