Thanks everyone, I will try to remember that about the case sensitive names and the 'alias'.
------------------
Announcement
Collapse
No announcement yet.
How to call this DLL??
Collapse
X
-
Guest replied
-
DECLARE FUNCTION el__OpenHW LIB "Eleye416" (BYVAL hexswitch AS LONG, BYVAL mode AS LONG) AS LONG
Edit your function as follows:
DECLARE FUNCTION el__OpenHW LIB "Eleye416.DLL" ALIAS "el__OpenHW" (BYVAL hexswitch AS LONG, BYVAL mode AS LONG) AS LONG
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?
Why did you not see the MSGBOX result? Again, a simple explanation... you ran this code directly from within the IDE, right? If you tried to launch it via the Debugger or launch the EXE directly from Explorer, you would have seen the error message appear. When the IDE launches the application via "Compile and Run", load-time failure messages are suppressed.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
Guest repliedThanks, it works!
Care to explain why
------------------
Leave a comment:
-
Thierry,
you might want to try a few things:
- Try adding an ALIAS in the declaration line.
- Try adding the full path to the DLL in the declare
- Try adding Lib "Eleye416.DLL"
Knuth
------------------
http://www.softAware.de
Leave a comment:
-
Add Alias "el__OpenHW" in Declare statement (it's compiler's jokes)
It seems to me, that without Alias compiler converts all letters to upper register.
[This message has been edited by Semen Matusovski (edited May 16, 2000).]
Leave a comment:
-
How to call this DLL??
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?
ThanksTags: None
Leave a comment: