Results 1 to 3 of 3

Thread: Using COM Objects in VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Chicago, IL
    Posts
    26
    Hello All

    I've built a COM object using Visual C++. Now I'm trying to use this object I've built in Visual Basic. I've included the .dll that was built in references, but I'm having trouble trying to create the object.

    Dim msg
    set msg = CreateObject("Module.classname")

    is that what i'm supposed to be doing?

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658

    Thumbs up I was confused to start with as well

    I am using COM objects built in C++ in VB as well. You have to have them referenced and registered.

    My dll is called cb2Manager.dll

    Code:
    'this is how i declare it so VB can list the 
    'properties and methods
    Dim myGlCreator As CB2MANAGERLib.cbCreator
    
    'Then i create the object like this.
    '1 is a version number.
    Set myGlCreator = CreateObject("cb2Manager.cbCreator.1")
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Chicago, IL
    Posts
    26
    Hey lain17

    Thanks a ton! it worked. it turns out the dll did not get registered somehow.

    Thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width