Re: How to Implements pure abstract interface
"Barzo" <dbarzo@gmail.com> wrote in message
news:65519def-9eb2-4d75-8249-c205ef13b251@r33g2000yqn.googlegroups.com
On the web I found this article:
Exposing Multiple Interfaces to Scripting Clients
http://www.sellsbrothers.com/tools/multidisp/
and it seems to be my case, isn't it?
How would I know what your case is?
So, I have to pay particulary attention to implement more than one
interface into a single object?
The article is not about difficulties of implementing more than one
interface - there are no difficulties there. The article is about trying
to expose functionality from multile interfaces to scripting clients.
You see, scripting clients only know how to use IDispatch, and of course
you can only have one IDispatch implementation in your object, hence the
need for all these tricks.
BTW, with my last question I mean that when I create an ATL object
with the wizard, it add the:
coclass ATDevice
{
[default] interface IATDevice;
};
while it doesn't add the "interface IATDevice;" into MyATDevice
coclass (I add it by hand),
What's the relationship between ATDevice and MyATDevice, apart from
superficial similarity of names?
so... since the IATDevice must remain abstract I would know if can I
delete the ATDevice coclass entry!
Well, you need _some_ coclass entry. It defines the CLSID for your
object. Also, in your example you have
Dim CDev As New CMyATDevice
This assumes there's a "coclass CMyATDevice" statement in your IDL. Is
there?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925