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. Visual Basic
  4. C++ dll calling from Vb

C++ dll calling from Vb

Scheduled Pinned Locked Moved Visual Basic
c++question
6 Posts 3 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.
  • S Offline
    S Offline
    Shenthil
    wrote on last edited by
    #1

    Hi, I have a dll writen in C++ which contains a fn that takes a char** parameter. Now, if I call this fn from a VB application, how can I specify aargument-value to the fn. it shows a 'long' in my VB method call. Shenthil

    H F 2 Replies Last reply
    0
    • S Shenthil

      Hi, I have a dll writen in C++ which contains a fn that takes a char** parameter. Now, if I call this fn from a VB application, how can I specify aargument-value to the fn. it shows a 'long' in my VB method call. Shenthil

      H Offline
      H Offline
      Hesham Amin
      wrote on last edited by
      #2

      char** means : pointer to pointer of type char pointers are 4 byte integers in Win32 so long is the VB6 type that can represent it.. If you use COM pass BSTRs not chars

      1 Reply Last reply
      0
      • S Shenthil

        Hi, I have a dll writen in C++ which contains a fn that takes a char** parameter. Now, if I call this fn from a VB application, how can I specify aargument-value to the fn. it shows a 'long' in my VB method call. Shenthil

        F Offline
        F Offline
        f64
        wrote on last edited by
        #3

        Hi Shenthil, Check this article from the Microsoft Knowledge base HOWTO: Pass a String Between Visual Basic and Your C DLL Fabian

        S 2 Replies Last reply
        0
        • F f64

          Hi Shenthil, Check this article from the Microsoft Knowledge base HOWTO: Pass a String Between Visual Basic and Your C DLL Fabian

          S Offline
          S Offline
          Shenthil
          wrote on last edited by
          #4

          Thanks a lot Shenthil

          1 Reply Last reply
          0
          • F f64

            Hi Shenthil, Check this article from the Microsoft Knowledge base HOWTO: Pass a String Between Visual Basic and Your C DLL Fabian

            S Offline
            S Offline
            Shenthil
            wrote on last edited by
            #5

            see, I am using the foll. Win32 API. here I want to pass the argument for the third parameter- lpServiceArgVectors . If I call the same api from my .cpp program I will pass the arg.vectors or arg.array. But, in VB how can I pass the vector/array. can u help me? Public Declare Function StartService Lib "advapi32.dll" Alias "StartServiceA" (ByVal hService As Long, ByVal dwNumServiceArgs As Long, ByVal lpServiceArgVectors As Long) As Long Shenthil

            F 1 Reply Last reply
            0
            • S Shenthil

              see, I am using the foll. Win32 API. here I want to pass the argument for the third parameter- lpServiceArgVectors . If I call the same api from my .cpp program I will pass the arg.vectors or arg.array. But, in VB how can I pass the vector/array. can u help me? Public Declare Function StartService Lib "advapi32.dll" Alias "StartServiceA" (ByVal hService As Long, ByVal dwNumServiceArgs As Long, ByVal lpServiceArgVectors As Long) As Long Shenthil

              F Offline
              F Offline
              f64
              wrote on last edited by
              #6

              Hi Check this one HOWTO: Pass Arrays Between Visual Basic and C Fabian

              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