CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2001
    Posts
    8

    How to create Type Library (DLL) in C++ to add as reference for VB

    Hiya to all GURUS out there

    Could anyone please advice me in how to create a Type Library using Visual C++ so that I could add it into a Visual Basic Project as a reference?

    In fact, a step-by-step guide would do. And as an example, an extremely simple Type Library would suffice as demonstration.

    Thanks in advance



  2. #2
    Join Date
    Feb 2001
    Location
    Israel
    Posts
    94

    Re: How to create Type Library (DLL) in C++ to add as reference for VB

    There are many kinds of DLL you can make ,
    The most automated way as I see it is using COM dll.

    In VC++ you just make a new ATL COM projects , choose DLL and add your methods and Properties.

    Thats is the general Idea.
    If you know C++ well you can jsut write a DLL and import it in the VB GUI.


    FatMan


  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: How to create Type Library (DLL) in C++ to add as reference for VB

    There is also a MKTYPLIB utility.
    You create a .def file and run this and it makes the .tlb file.

    It's documented at http://msdn.microsoft.com

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Mar 2001
    Posts
    13

    Re: How to create Type Library (DLL) in C++ to add as reference for VB

    hi,

    I have tried your method.
    But I have error message.
    How the def file look like?
    Is it same as any DLL export file?

    thank you!


  5. #5
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: How to create Type Library (DLL) in C++ to add as reference for VB

    No, you need to write up a type lib description in something called the "Object Description language".
    The best explanation is at http://msdn.microsoft.com/library/books/inole/S111F.HTM

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  6. #6
    Join Date
    Mar 2001
    Posts
    13

    Re: How to create Type Library (DLL) in C++ to add as reference for VB

    hi

    I have successfully created a DLL in VC++ and added into VB GUI by using the "add reference".
    However when I used the "Object Browser" to view it.
    I can only see my class but not its member function.
    Do you know what the problem?
    I create the function in VC++ by using "add member function".

    thank you!


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

Featured