digitalmars.D - Why is MS-COM a language feature?
- Frank Benoit (8/8) Jul 29 2008 This is inspired by the question of Bill B. from the "Comparing
- Extrawurst (4/5) Jul 29 2008 I am using it. I use it to interface to DirectX components.. But as long...
- davidl (11/19) Jul 29 2008 Maybe because Java Interface is pure. D interface is not pure, defaultly...
- davidl (19/40) Jul 29 2008 sorry for the mistake i made here.
This is inspired by the question of Bill B. from the "Comparing interfaces does not call opEquals" thread. Even Java can bridge to COM without language support. See SWT. So if it is possible to connect to COM with lib functions, why have it directly supported by the language? Who of this community is actually using COM? How is your experience? What is possible? What is not? Could it be done in a lib? Wouldn't it make much sense to throw the COM support out of D entirely?
Jul 29 2008
Frank Benoit schrieb:Who of this community is actually using COM?I am using it. I use it to interface to DirectX components.. But as long as i can do that i dont care if it is by language feature or lib (that is if its not more work, lazy coder u know)
Jul 29 2008
在 Wed, 30 Jul 2008 04:40:38 +0800,Frank Benoit <keinfarbton googlemail.com> 写道:This is inspired by the question of Bill B. from the "Comparing interfaces does not call opEquals" thread. Even Java can bridge to COM without language support. See SWT. So if it is possible to connect to COM with lib functions, why have it directly supported by the language?Maybe because Java Interface is pure. D interface is not pure, defaultly interface not inherited from IUnknown, you get opEquals, opCmp, etc vtbl from class Object. So it's better call it IPure, not IUnknown so windows specific(from the first view).Who of this community is actually using COM? How is your experience? What is possible? What is not? Could it be done in a lib?You can't get a pure interface without IUnknown compiler support.Wouldn't it make much sense to throw the COM support out of D entirely?-- 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
Jul 29 2008
在 Wed, 30 Jul 2008 09:47:37 +0800,davidl <davidl 126.com> 写道:在 Wed, 30 Jul 2008 04:40:38 +0800,Frank Benoit <keinfarbton googlemail.com> 写道:sorry for the mistake i made here. code in object.d /** * Information about an interface. * A pointer to this appears as the first entry in the interface's vtbl[]. */ struct Interface { ClassInfo classinfo; /// .classinfo for this interface (not for containing class) void *[] vtbl; int offset; /// offset to Interface 'this' from Object 'this' } it's clear that, D Interface gets a special memory layout. While IUnknown means your first entry not pointing to this struct.This is inspired by the question of Bill B. from the "Comparing interfaces does not call opEquals" thread. Even Java can bridge to COM without language support. See SWT. So if it is possible to connect to COM with lib functions, why have it directly supported by the language?Maybe because Java Interface is pure. D interface is not pure, defaultly interface not inherited from IUnknown, you get opEquals, opCmp, etc vtbl from class Object.So it's better call it IPure, not IUnknown so windows specific(from the first view).-- 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/Who of this community is actually using COM? How is your experience? What is possible? What is not? Could it be done in a lib?You can't get a pure interface without IUnknown compiler support.Wouldn't it make much sense to throw the COM support out of D entirely?
Jul 29 2008