描述:
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(464adae8-6c3f-4c17-9a79-46c5221daba6),
dual,
helpstring("IATLConPropertyVisitor Interface"),
pointer_default(unique)
]
interface IATLConPropertyVisitor : IDispatch
{
[propput, helpstring("Set the interface to browse")]
HRESULT Dispatch([in]IDispatch* pDispatch);
[propget, helpstring("Get the interface being browsed")]
HRESULT Dispatch([out,retval]IDispatch** ppDispatch);
};
[
uuid(b5265b2a-509b-456c-b968-cf14a51cb142),
version(1.0),
helpstring("ATLContainer 1.0 Type Library")
]
library ATLCONTAINERLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(b04f638e-5836-415e-90e4-25ae70efc06a),
helpstring("ATLConPropertyVisitor Class")
]
coclass ATLConPropertyVisitor
{
[default] interface IATLConPropertyVisitor;
};
};
error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode : [ Interface 'IATLConPropertyVisitor' ]
error MIDL2096 : duplicated attribute : [helpstring] [ Interface 'IATLConPropertyVisitor' ]
error MIDL2096 : duplicated attribute : [uuid] [ Interface 'IATLConPropertyVisitor' ]
Error executing midl.exe.
解决方案1:
[
object,
uuid(464adae8-6c3f-4c17-9a79-46c5221daba6),
dual,
helpstring("IATLConPropertyVisitor Interface"),
pointer_default(unique)
]
interface IATLConPropertyVisitor : IDispatch
{
[propput, helpstring("Set the interface to browse")]
HRESULT Dispatch([in]IDispatch* pDispatch);
[propget, helpstring("Get the interface being browsed")]
HRESULT Dispatch([out,retval]IDispatch** ppDispatch);
};
把上面的部分放到 library ATLCONTAINERLib 里面来试试。