PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → File descriptor in WinDev
File descriptor in WinDev
Débuté par Naveen Rathan, 03 juil. 2015 07:31 - 1 réponse
Posté le 03 juillet 2015 - 07:31
Hi all,

I want to pass an file descriptor to an external library. Below is what I tried:

temp is int = fOpen("DebugTrace.txt", foAdd)

In C fOpen returns file descriptor, whereas here I am getting File ID which will be like 2/3 etc..

I want to do below API call:

API("extrenal.dll","API_NAME",file_descriptor)

Any suggestions?

Thanks and Regards,
Naveen Rathan
Posté le 08 juillet 2015 - 12:38
Hi Naveen,

Here is the code:
FileName is string ASCIIZ on 256 //Check length of string in API documentation FileHandle is int FileName = "C:\\Directory\\FileName.txt" //In C you normally need to escape the \ character by adding another \ to it. Check your API documentation if this is required. APIResult = API("External.DLL","FunctionName",&FileName) //In C you need to pass the memory address to the string. You do this by prefixing the variable with the & character.
Cheers,

Peter H.