byref t ype mismatch
-
I have the C dll:
#include
#includeint _stdcall CallMe(int *a, int *b)
{
char ab[20];sprintf(ab,"The value of a is %d \n",a);
MessageBox (NULL, ab, "Test DLL", MB_OK);
b = a;return 0;
}
with the .def file:
LIBRARY builderDll
EXPORTS
CallMe (int *a, int* b) @1I call this from VB as follows:
Private Declare Function CallMe Lib "C:\PMARModif\builderDll\Debug\builderDll.dll" (ByVal a As Long, ByRef b As Long) As Long
Private Sub Command1_Click()Dim a As Integer
Dim b As Integer
a = 10CallMe a, b
Form1.Print b
End SubWhen I try to run I get a
byref argument type mismatch
pointing at b Appreciate your help, ns -
I have the C dll:
#include
#includeint _stdcall CallMe(int *a, int *b)
{
char ab[20];sprintf(ab,"The value of a is %d \n",a);
MessageBox (NULL, ab, "Test DLL", MB_OK);
b = a;return 0;
}
with the .def file:
LIBRARY builderDll
EXPORTS
CallMe (int *a, int* b) @1I call this from VB as follows:
Private Declare Function CallMe Lib "C:\PMARModif\builderDll\Debug\builderDll.dll" (ByVal a As Long, ByRef b As Long) As Long
Private Sub Command1_Click()Dim a As Integer
Dim b As Integer
a = 10CallMe a, b
Form1.Print b
End SubWhen I try to run I get a
byref argument type mismatch
pointing at b Appreciate your help, nsat first glance, i would say that you're passing in
long
when the function takesint
?????? Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain