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. Using VB dll in C++

Using VB dll in C++

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorial
3 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.
  • K Offline
    K Offline
    Killen
    wrote on last edited by
    #1

    Hi! I'm trying to use some functions in a dll written in VB 6.0. I have sample code for using the dll from VB (se below) but I don't really know how to go about using it from my C++ app. Any help would be very much appreciated! VB code exemple: 'Declaration: Private MyVBObject As New TheVBObject.cTheVBObject 'Startup: If Not MyVBObject.Init("Arg1","Arg2","Arg3") Then MsgBox "Init Fail!", vbCritical & vbOKOnly, "Init" End End If 'Use: MyVBObject.Var1 = " " If MyVBObject.DoStuff("Arg1","Arg2") Then If MyVBObject.Error > 3 _ And (MyVBObject.Error <> 4) Then MsgBox MyVBObject.ErrTxt frmObject.MousePointer = vbNormal Exit Sub End If Else MsgBox "Error using it", vbCritical & vbOKOnly, "Using" End If 'Read the properties... 'Dim MyProp = MyVBObject.Prop1 '... or something like that...

    A 1 Reply Last reply
    0
    • K Killen

      Hi! I'm trying to use some functions in a dll written in VB 6.0. I have sample code for using the dll from VB (se below) but I don't really know how to go about using it from my C++ app. Any help would be very much appreciated! VB code exemple: 'Declaration: Private MyVBObject As New TheVBObject.cTheVBObject 'Startup: If Not MyVBObject.Init("Arg1","Arg2","Arg3") Then MsgBox "Init Fail!", vbCritical & vbOKOnly, "Init" End End If 'Use: MyVBObject.Var1 = " " If MyVBObject.DoStuff("Arg1","Arg2") Then If MyVBObject.Error > 3 _ And (MyVBObject.Error <> 4) Then MsgBox MyVBObject.ErrTxt frmObject.MousePointer = vbNormal Exit Sub End If Else MsgBox "Error using it", vbCritical & vbOKOnly, "Using" End If 'Read the properties... 'Dim MyProp = MyVBObject.Prop1 '... or something like that...

      A Offline
      A Offline
      Adam Gritt
      wrote on last edited by
      #2

      Check out MSDN Article #ID Q194873 example 2 for an easy way. Or look at http://www.codeproject.com/com/vb\_from\_vc.asp for some other helpful hints. It requires you to understand COM under C++ but the CP link is a beginners article that is easy to understand.

      K 1 Reply Last reply
      0
      • A Adam Gritt

        Check out MSDN Article #ID Q194873 example 2 for an easy way. Or look at http://www.codeproject.com/com/vb\_from\_vc.asp for some other helpful hints. It requires you to understand COM under C++ but the CP link is a beginners article that is easy to understand.

        K Offline
        K Offline
        Killen
        wrote on last edited by
        #3

        Thanks for the answer. The codeproject article was really great! /Killen

        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