[Issue 12607] Document that IUnknown classes must mark toString with extern(D) when overriding it

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 21 08:03:51 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12607

--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Andrej Mitrovic from comment #3)
> The only problem is, how do you call toString via an IUnknown interface?

You can't. Because the layout of IUnknown interfaces MUST follow COM, the RTTI
link to D's typeinfo system is missing. Remember that a proper D interface has
a mechanism of defining how to find the object start (and therefore the
vtable). An IUnknown interface does not have that.

Note that an IUnknown object may not even be a D object!

Once you go into IUnknown land, there's no coming back out (bwahahaha!)

--


More information about the Digitalmars-d-bugs mailing list