Results 1 to 2 of 2

Thread: ActiveX from VB

  1. #1

    Thread Starter
    Lively Member J Lindroos's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    97

    ActiveX from VB

    If I make a DLL in VB Let's say with a class with this functions in:

    Code:
    Public Variable As Integer
    
    Public Function Func1(Param As Integer) As String
    ...
    End Function
    How do I use the DLL and the class in C++?

    /J Lindroos
    ____________________
    "My opinions may have changed, but not the fact that I am right"

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It's debatable whether it particularly works in VC++, but...

    First, make sure that the VB ActiveX DLL is registered. Then, copy it to your source directory. Use the following code:
    Code:
    #import <dllname.dll>
    And then build it.

    Hopefully VC should generate some include files for you containing all the necessary code to interface with the DLL.

    Note: when using DLLs it's nearly always best to make them in C++ and call from VB using Declare than to do it this way round.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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