VB Call to VC DLL 
Author Message
 VB Call to VC DLL

I'm trying to call a Visual C DLL from a Visual Basic program.
I've searched for examples hi & low and the only one I found only
showed how to pass to integers by value. I need to call a DLL by passing
integers, strings and arrays and upon return, the values need to be
modified from the DLL.

I've included the simple example I found in a book. I would appreciate if
someone could give me an example of a VB call to a Visual C DLL, passing
an integer, string & array by reference. If someone could recommend a book
that goes into calling DLL's from Visual Basic, I would appreciate that

*** Visual Basic Calling Code Example ***

Declare Function SimpleCalc Lib "H:\2a\vb\testdll\scalcwin"
                                (ByVal Parm1%, ByVal Parm2%) As Integer

Private Sub Command1_Click()

Dim Parm1 As Integer
Dim Parm2 As Integer
dim RC as Integer

    Parm1 = 10
    Parm2 = 20
    RC = SimpleCalc(Parm1, Parm2)

End Sub

*** Visual C 1.5 DLL Example ***
#include <string.h>      
#include <windows.h>

 int _far _Pascal  SimpleCalc(int Parm1, int Parm2);
 int _far _pascal  SimpleCalc(int Parm1, int Parm2)
     return (Parm1 * Parm2);


Sun, 20 Sep 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. callbacks (VB calls a VC DLL)

2. vb calls vc dll and strings get chopped

3. Problems calling a VC DLL from VB

4. calling VC DLL from VB

5. Calling VC++ programs and VC created dlls from VB

6. Calling C DLLs with VB/VC 5

7. Calling VB DLLs from VC/C++

8. can you create a dll in VB and call in VC

9. Calling VB DLLs from VC/C++

10. vb calling vc dll :csaa

11. Problem calling DLL writen in VC 5.0 from VB 5.0

12. HELP! Calling a VC DLL from VB


Powered by phpBB® Forum Software