Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using API with PChar returned value

Status
Not open for further replies.

jpcrest

Programmer
Mar 12, 2002
7
FR
Hi,
I've some problems usind call of API when the function return a PChar. How can I read the value pointed by the Pchar within VFP ?
Also with the types of parameters or values like Byte,Boolean,Struct...
Thank's for your help !
Jean Paul
 
VFP doesn't have structures. Or data types of byte or pointers. You have to fudge a little. You have to use STRING or INTEGER, or STRING @ or INTEGER @. (@ = by reference/address, similar to a pointer.) That said, it sometimes takes a little testing to get the correct values back. Sometimes you have to take the returned value as a string, and convert it to numeric by byte ordering and then recombine/add them.

There are some good examples at:

Dave S.
 
Jean Paul,
Go to the UT ( click on the Download picture on the left, and choose the Visual FoxPro area. Next enter 'struct' (without the quotes) in the Title area and press Enter. You should get back an entry for:
struct.zip - "A Visual FoxPro class to simplify packing and unpacking of structures for use WINAPI functions or other DLLs Code is included."
There is excellent documentation on it's use in a .DOC file.

Rick
 
Thnks for your replies, I already use string, integers, etc with @ fir send parameters in the API call. My problem is how to do when the API return a pointer....The samples sites you give are very interesting ! Have good days (and sorry for my English !)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top