Errors From COM Object
-
Im having a problem with my COM object. The IDL file below describes my interface. In VB when I do a CreateObject, i get a type mismatch. When I try and declare a type "vbtopicstruct", i get an automation error 440? ANy help?
import "oaidl.idl"; import "ocidl.idl"; import "unknwn.idl"; typedef [ uuid(C21871A0-33EB-11D4-A13A-BE2573A1120F), helpstring("Topic Structure Definition") ] struct vbTopicStruct { long a; long b; long c; } vbTopicStruct; [ object, uuid(3C6C8D49-E7B3-4799-9EF6-37825D43064A), helpstring("IConvertTopic Interface Definition") ] interface IConvertTopic : IUnknown { HRESULT ReadTopicsFromFile([in] BSTR filename, [in, out]vbTopicStruct *topics); HRESULT WriteTopicsToFile ([in] BSTR filename, [in, out]vbTopicStruct *topics); }; [ uuid(3C6C8D4B-E7B3-4799-9EF6-37825D43064A), helpstring("Topic Conversion Interface Definition Library") ] library ConvertTopicDefinitionLibrary { importlib ("stdole32.tlb"); importlib ("stdole2.tlb"); struct vbTopicStruct; interface IConvertTopic; }
Ryan Baillargeon Software Specialist -
Im having a problem with my COM object. The IDL file below describes my interface. In VB when I do a CreateObject, i get a type mismatch. When I try and declare a type "vbtopicstruct", i get an automation error 440? ANy help?
import "oaidl.idl"; import "ocidl.idl"; import "unknwn.idl"; typedef [ uuid(C21871A0-33EB-11D4-A13A-BE2573A1120F), helpstring("Topic Structure Definition") ] struct vbTopicStruct { long a; long b; long c; } vbTopicStruct; [ object, uuid(3C6C8D49-E7B3-4799-9EF6-37825D43064A), helpstring("IConvertTopic Interface Definition") ] interface IConvertTopic : IUnknown { HRESULT ReadTopicsFromFile([in] BSTR filename, [in, out]vbTopicStruct *topics); HRESULT WriteTopicsToFile ([in] BSTR filename, [in, out]vbTopicStruct *topics); }; [ uuid(3C6C8D4B-E7B3-4799-9EF6-37825D43064A), helpstring("Topic Conversion Interface Definition Library") ] library ConvertTopicDefinitionLibrary { importlib ("stdole32.tlb"); importlib ("stdole2.tlb"); struct vbTopicStruct; interface IConvertTopic; }
Ryan Baillargeon Software Specialist