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. C / C++ / MFC
  4. How can I use a VB library, in VC++

How can I use a VB library, in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
8 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.
  • M Offline
    M Offline
    mr2003
    wrote on last edited by
    #1

    Hi, I have a VB library file which has many functions/constants. How can I use that in a VC++ program? Should I make a VB dll file, and include all of the functions in it? Ehsan Behboudi

    A 1 Reply Last reply
    0
    • M mr2003

      Hi, I have a VB library file which has many functions/constants. How can I use that in a VC++ program? Should I make a VB dll file, and include all of the functions in it? Ehsan Behboudi

      A Offline
      A Offline
      AlexO
      wrote on last edited by
      #2

      You have to covert it to COM library.

      M 2 Replies Last reply
      0
      • A AlexO

        You have to covert it to COM library.

        M Offline
        M Offline
        mr2003
        wrote on last edited by
        #3

        how can I do that? Ehsan Behboudi

        1 Reply Last reply
        0
        • A AlexO

          You have to covert it to COM library.

          M Offline
          M Offline
          mr2003
          wrote on last edited by
          #4

          ok i just checked,, the library is written according to COM. what should i do next? Ehsan Behboudi

          A 1 Reply Last reply
          0
          • M mr2003

            ok i just checked,, the library is written according to COM. what should i do next? Ehsan Behboudi

            A Offline
            A Offline
            AlexO
            wrote on last edited by
            #5

            use #import "myvbcode.dll" during c++ compilation it would generate myvbcode.tlh myvbcode.tli which are automatically included then just select the functionality you need. If you need more help, publish generated .tli file here and example of how you would use it in VB.

            A M 2 Replies Last reply
            0
            • A AlexO

              use #import "myvbcode.dll" during c++ compilation it would generate myvbcode.tlh myvbcode.tli which are automatically included then just select the functionality you need. If you need more help, publish generated .tli file here and example of how you would use it in VB.

              A Offline
              A Offline
              AlexO
              wrote on last edited by
              #6

              P.S. #import "libid:12341234-1234-1234-1234-123412341234" where 12341234-1234-1234-1234-123412341234 is you LIBID, is preferable. This way you do not depend on the location of the COM dll during compilation.

              1 Reply Last reply
              0
              • A AlexO

                use #import "myvbcode.dll" during c++ compilation it would generate myvbcode.tlh myvbcode.tli which are automatically included then just select the functionality you need. If you need more help, publish generated .tli file here and example of how you would use it in VB.

                M Offline
                M Offline
                mr2003
                wrote on last edited by
                #7

                where in the VC++ program should I add #import "myvbcode.dll" ?? Ehsan Behboudi

                A 1 Reply Last reply
                0
                • M mr2003

                  where in the VC++ program should I add #import "myvbcode.dll" ?? Ehsan Behboudi

                  A Offline
                  A Offline
                  AlexO
                  wrote on last edited by
                  #8

                  Stdafx.h usually is a good place. In general, it should be treaded as any other include file - you put right before the code that uses it. the actual #import "myvbcode.dll" is substituted at compile time for #include "myvbcode.tlh" #include "myvbcode.tli"

                  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