I am really desperate. I bought a framegrabber that is supplied with a dll. However all the samples are in C/C++. There is some info for VB users that says:
The DLL routines "el_XXXXX" are declared as C-functions and can not simply be used in Visual Basic programs. But there is a second set of functions "el__XXXXX" with two "__" which are declared as stdcall so they can be used in Visual Basic.
Just declare the functions needed as follows:
Declare Function el__OpenHW Lib "Eleye416" (Byval Hexswitch as long, Byval Mode as long) as Long
So I wrote a simple vb program with the previous declare in a module and a small test program. The program worked. I copied the same to PB and it doesn't do as thing!! Why?
Here is the program:
$COMPILE EXE
DECLARE FUNCTION el__OpenHW LIB "Eleye416" (BYVAL hexswitch AS LONG, BYVAL mode AS LONG) AS LONG
FUNCTION PBMAIN
DIM t&
t& = el__OpenHW (0, 0)
MSGBOX STR$(t&)
END FUNCTION
When I run this program in vb I get '-1' in the messagebox, which is correct. When I run this in pb I don't even see the messagebox. If I delete the line 't& = el__OpenHw(0,0) then I see the messagebox. Can anyone explain?
Thanks
The DLL routines "el_XXXXX" are declared as C-functions and can not simply be used in Visual Basic programs. But there is a second set of functions "el__XXXXX" with two "__" which are declared as stdcall so they can be used in Visual Basic.
Just declare the functions needed as follows:
Declare Function el__OpenHW Lib "Eleye416" (Byval Hexswitch as long, Byval Mode as long) as Long
So I wrote a simple vb program with the previous declare in a module and a small test program. The program worked. I copied the same to PB and it doesn't do as thing!! Why?
Here is the program:
$COMPILE EXE
DECLARE FUNCTION el__OpenHW LIB "Eleye416" (BYVAL hexswitch AS LONG, BYVAL mode AS LONG) AS LONG
FUNCTION PBMAIN
DIM t&
t& = el__OpenHW (0, 0)
MSGBOX STR$(t&)
END FUNCTION
When I run this program in vb I get '-1' in the messagebox, which is correct. When I run this in pb I don't even see the messagebox. If I delete the line 't& = el__OpenHw(0,0) then I see the messagebox. Can anyone explain?
Thanks
Comment