Bug 2041 – Spec implies relationship between interfaces and COM objects
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-04-26T13:54:00Z
Last change time
2015-06-09T01:14:36Z
Assigned to
bugzilla
Creator
jlquinn
Comments
Comment #0 by jlquinn — 2008-04-26T13:54:25Z
The following bit of text about interfaces:
Interfaces correspond to the interface exposed by operating system objects, like COM/OLE/ActiveX for Win32.
implies that there is some kind of connection between an interface and Win32 COM objects. Is this the intention? If so, what does that mean on Linux and other Unixen platforms? What exactly does it mean on Win32 in this case? Is there an active tie into those objects?
If not, this should be more clearly reworded to indicate it is just an analogy. A better analogy would probably be to Java interfaces, as D interfaces appear to be very similar if I'm not mistaken.
Comment #1 by smjg — 2008-11-23T19:22:45Z
It isn't just an analogy. By intention, it's talking about compatibility in the ABI between D interfaces and COM, which is a quite different concept from that of having the same overall meaning as in some other programming language.
Hence you can use D interfaces to interact with Windows COM objects, and even to create COM objects of your own. See the "Com Interfaces" section further down that page.
The statement I'm not sure about is "It derives from the interface std.c.windows.com.IUnknown." It seems that win32.unknwn.IUnknown should work just as well.
I myself am not familiar with COM enough to know how to try it out, but hope this helps.
Comment #2 by jarrett.billingsley — 2008-11-23T19:34:10Z
I think the only misleading part about it is that it says "interfaces correspond to the interface exposed by operating system objects." That, to me, implies that they are primarily meant for use with operating system interaction. That's pretty far from the truth. It should say something like "D also has support for interfaces which correspond to COM/OLE/ActiveX objects on Windows."