Question for add new interface?

09/02/2004 - 05:12 por Frank | Informe spam
hi,there

For some reason, I used ATL object wizard created a simple object, you know,
it created a default interface of that object. And then, I wanna add a NEW
INTERFACE into that simple object created without type library, NEW
INTERFACE means a real new interface, which has not IID and any type
library. I dont know how to add a new interface into my simple object, how
to create a IID associated with that interface and...
As you see, I am a perfect beginner. Tell me how you do that or give me some
tricks or suggestions.

Any reply is appreciated :p

Frank F.Han

+--+
| winsays@:-)hotmail:-).com |
+--+
 

Leer las respuestas

#1 Andrew Jarvis
09/02/2004 - 12:08 | Informe spam
IDL file
=
The easiest way is to copy the wizard generated interface and rename it.

Create a new uuid by incrementing the eight digit hex number in the existing
uuid. If you run guidgen.exe and keep clicking 'New GUID' you will see that
it does just that.

Find the coclass declaration and add your new interface, omitting the
[default] specifier as you can't have two defaults.

Class header file
=If you are using custom interfaces then simply derive the class from your
interface and add a COM_INTERFACE_ENTRY for it.

If you are using dual interfaces, copy and modify the IDispatchImpl line for
the default interface, and add a COM_INTERFACE_ENTRY for it.

You will also need to change the line
COM_INTERFACE_ENTRY(IDispatch)
to
COM_INTERFACE_ENTRY2(IDispatch, xxx)
where xxx is the name of the default interface.

I think that's covered everything.

AJ


"Frank" wrote in message
news:
hi,there

For some reason, I used ATL object wizard created a simple object, you


know,
it created a default interface of that object. And then, I wanna add a NEW
INTERFACE into that simple object created without type library, NEW
INTERFACE means a real new interface, which has not IID and any type
library. I dont know how to add a new interface into my simple object, how
to create a IID associated with that interface and...
As you see, I am a perfect beginner. Tell me how you do that or give me


some
tricks or suggestions.

Any reply is appreciated :p

Frank F.Han

+--+
| winsays@:-)hotmail:-).com |
+--+


Preguntas similares