Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C Structure query
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00612717
Message ID:
00613332
Views:
35
>Thanks for the information. Passing by reference with @ is fine for simple structures, the problem I faced was that the structure itself is made up of other pointers (CHAR*) and LONG values. If it were just LONG values I could pass the relevant number of bytes (number of LONG values multiplied by 4) but the pointers to the CHAR variables really threw me. Is there a way to create a structure to pass to the function by reference that contains other values passed by reference?
>
>In the interim I have created a VB OCX that wraps around the API command and slots into Fox... It would be nice to be able to do it in pure fox though... to date I've found that there is very little that Fox *cannot* do.

Yes, it can.
First, there is a Christof Lange's struct class in UT downloads.
Next, you can allocate memory for string using WinAPI function GlobalAlloc (or something similar), get a pointer to memory with GlobalLock, copy string to buffer and store pointer value in structure. After call of function you have to free the memory by GlobalFree.
But IMO for such kind of tasks there is a C++ language. With C++ you could solve this problem within one hour and avoid a VB runtime overhead.

Alexander
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform