Can I use C ++ functions in Visual Basic?

I am new to programming, but I created a pretty good library for calculating mathematical problems such as quadratic equations and many others. Now I met a friend and programmed programming in VB a bit, and we were thinking, is it possible to import my functions from C ++ into his code so that he can call them when they are needed, so that we can make a calculator? How can we do this?

  • Janman

Edit: My friend uses VB.net Edit: My library is organized in free functions.

+3
source share
2 answers

To use C ++ code from VB, you have the following options:

  • Create a DLL where you export functions; and call them from VB as follows

    Declare Sub test Lib "c:\somepath\test.dll" (ByVal a As String, ByVal b As String, c As Long)
    
  • Com ATL MFC DLL VB, VB ++ Com.

    /li >
+7

- :

Declare Function GetDesktopWindow Lib "user32" () As Long

, ++, C DLL .

+1

Source: https://habr.com/ru/post/1789301/


All Articles