Re: share event interface
"Sue" <jean.shu@gmail.com> wrote in message
news:1181169581.435120.230820@n15g2000prd.googlegroups.com
I create a idl file and put the shared interfaces inside the idl file,
but when I run the midl trying to generate the .tlb file, it's not
generated. I can't find the .tlb file anywhere. But it generate
the .h and .c file fine. Any idea?
The interface definition has to be inside a library block, or at least
mentioned in the library block.
//plugincomm.idl
[
object,
uuid(50E189C6-1805-4E38-A3CB-8DB7FCC5FD01),
dual,
nonextensible,
helpstring("ISAProcessHandler Interface"),
pointer_default(unique)
]
interface ISAProcessHandler : IDispatch{
This is not your event interface, right? An event interface cannot be
dual, it must be a dispinterface (most common) or a custom interface.
[
uuid(4F576024-FCA8-4068-9C21-98F8BAF4C4A1),
helpstring("ISAProcessEvent interface")
]
interface ISAProcessEvent : IDispatch
{
[id(1), helpstring("method ProcessOver")] HRESULT
ProcessOver( [out,retval] BSTR* pbstrText );
};
This is wrong. I'm not sure how it compiles. If you want a dual
interface, mark it dual. If you want a dispinterface, make it
[
uuid(4F576024-FCA8-4068-9C21-98F8BAF4C4A1),
helpstring("ISAProcessEvent interface")
]
dispinterface ISAProcessEvent
{
properties:
methods:
[id(1), helpstring("method ProcessOver")]
BSTR ProcessOver();
};
--
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