>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
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.