Hi Everybody,
I have looked at many posts and am trying to add external DLL calls to my app.
Can someone please tell me where I am going wrong.
Syntax :
Function Connect() as String
Return values:
Success - Port number
Error - Empty String
DLL32 FUNCTION Connect() AS LPSTR PASCAL LIB "\Ez\dll\POx.DLL"
Syntax :
Function Handshake() as Boolean
Return values:
Success - TRUE
Error - FALSE
DLL32 FUNCTION Handshake() AS BOOL PASCAL LIB "\Ez\dll\POx.DLL"
Syntax :
Function SetID(id as String) as Boolean
Return values:
Success - TRUE
Error - FALSE
DLL32 FUNCTION SetID(ID AS LPSTR) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"
Syntax :
Function SetTime( cur_time as Date) as Boolean
Return values:
Success - TRUE
Error - FALSE
DLL32 FUNCTION SetTime(cur_time AS Date) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"
Syntax :
Function SetInterval(interval as Integer) as Boolean
Return values:
Success - TRUE
Error - FALSE
DLL32 FUNCTION SetInterval(interval AS LONG) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"
Syntax :
Function GetData(data_array()) as integer
Return values:
Success - Number of Data lines
Error - 0
DLL32 FUNCTION GetData(data_array()) AS LONG PASCAL LIB "\Ez\dll\POx.DLL"
Thanks,
Jeff
Adding External DLL Calls
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Jeff,
Try it this way:
James
Try it this way:
Code: Select all
local hPOX := LoadLibrary( "\ez\dll\POX.DLL" )
DLL32 FUNCTION ... LIB hPOX
...
FreeLibrary( hPOX )
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Jeff,
I'm not experienced with DLL32 calls, but I notice other working calls (in my notes) use the FROM clause and the same name as the function with a trailing "A" so you might try:
DLL32 FUNCTION Connect ... FROM "ConnectA" LIB hPOX
If that doesn't work, hopefully someone else with DLL experience will help.
James
I'm not experienced with DLL32 calls, but I notice other working calls (in my notes) use the FROM clause and the same name as the function with a trailing "A" so you might try:
DLL32 FUNCTION Connect ... FROM "ConnectA" LIB hPOX
If that doesn't work, hopefully someone else with DLL experience will help.
James
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Adding External DLL Calls
As far as I know, you can't return a string from a DLL function. Do you have any VB samples?Jeff Barnes wrote:Syntax :
Function Connect() as String
Return values:
Success - Port number
Error - Empty String
DLL32 FUNCTION Connect() AS LPSTR PASCAL LIB "\Ez\dll\POx.DLL"
AS BOOL instead of AS WORD.Jeff Barnes wrote:Syntax :
Function SetID(id as String) as Boolean
Return values:
Success - TRUE
Error - FALSE
DLL32 FUNCTION SetID(ID AS LPSTR) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"
There's nothing like AS Date.Jeff Barnes wrote:DLL32 FUNCTION SetTime(cur_time AS Date) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"
There's nothing like data_array() without data type.Jeff Barnes wrote:DLL32 FUNCTION GetData(data_array()) AS LONG PASCAL LIB "\Ez\dll\POx.DLL"
EMG
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact: