Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't Pass Parameters to The DLL
Message
From
23/01/1999 04:14:13
 
 
To
23/01/1999 02:36:04
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00179341
Message ID:
00179347
Views:
22
>I have downloaded a DLL written in Dephi which use for VB and i try to use it in VFP 5 ,but a problem occur. Since in VB it also has a declare command to call the DLL, but in VB it is pass parameters to the procedure. I found that in VFP is pass to function.
> Below is my code. my DLL file is inpout32.dll
>>DECLARE Integer Inp IN inpout32.dll AS Inp32 integer PortAddress
>>DECLARE Out IN inpout32 AS Out32.dll integer PortAddress, integer
>>Signal
>
>>*PortAddress = 739
>>Signal = 128
>>Out(PortAddress, Signal)
>>PortAddress = 736
>
>when i run it error message display !! "File out.prg dost not exist"
>Anyone know how to solve it ?

It looks like you've got both the DECLARE and the invocation wrong. Assuming that the idea behind the prototype shown above is correct, try the code below instead. If this doesn't work, but you have working VB code to decalre and invoke the .DLL functions, post that so that we can see what the correct declaraction should be.
DECLARE INTEGER Inp IN INPOUT32.DLL AS Inp32 Integer PortAddress
DECLARE INTEGER Out IN INPOUT32.DLL AS Out32 INTEGER PortAddress, INTEGER Signal
*  Invoke Out() with port 739, signal 128.  use the name from the AS
Out32(739, 128)
If you use an AS clause, you must refer to the function via the name given in the AS clause. The name assigned with AS is not a .DLL, but an entry point, and you really ought to explicitly reference the source as a .DLL except when using the keyword WIN32API, which references the call within a predefined search set of common Win32 .DLLs, avoiding name differences across operating systems.

>Actually the DLL is written for VB and inside the DLL is use procedure not function.
>Can i pass the parameters to the procedure inside the DLL ?

That's exactly what you do in the invocation; the arguments within the parentheses are passed by value to the specific .DLL entrypoint declared with the referenced name.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform