Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

C++ classes in VB

  • 30-08-2000 03:44PM
    #1
    Subscribers Posts: 1,911 ✭✭✭


    Background:
    I wrote an API for doing digital signing out of one of my company's products. Company B wants to use this API. API is in C++, Company B's product is written in VB.

    Question:
    Can they use the C++ functions and classes from the API directly in their VB or are we going to have write some sort of wrapper?

    Draco


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Nope they should be able to use it directly from VB.



  • Closed Accounts Posts: 218 ✭✭Void


    Calling functions isn't a problem, it goes something like this:
    Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long

    Where "Lib" is the name of your dll or whatever. As for classes, that's slightly trickier. You could make your API into an ActiveX control, then it could be directly inserted into a VB project.


  • Subscribers Posts: 1,911 ✭✭✭Draco


    Originally posted by Void:
    As for classes, that's slightly trickier. You could make your API into an ActiveX control, then it could be directly inserted into a VB project.
    This is exactly what I was looking for.

    Thanks.

    Draco



    http://www.theyshoulddie.com
    Making the world a better place one person at a time.


Advertisement