Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Errors From COM Object

Errors From COM Object

Scheduled Pinned Locked Moved COM
helpcomtestingtoolsquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ryan B
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • R Ryan B

      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

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      The IDL doesn't include a CoClass, is this because either your IDL or resultant TLB is included/imported into another IDL file? Steve S [This signature space available for rent]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups