Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using STRUCT in VFP
Message
From
27/06/1999 14:15:32
 
 
To
27/06/1999 10:41:31
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00234488
Message ID:
00234536
Views:
23
>Hi,
> How could I calling API that require STRUCT whereby all of the elements within the structure in not the same datatype? I tried to put theim in array and pass by @, but error - too many parameter..

You need to build the structure in a string or in a static block of memory and use that to contain the structure; whether you can use a VFP string or not depends largely on whether you need to have embedded pointers to static locations within the structure. Depending on what is being passed and how you pass things, you may need to change some elements of the DECLARE...DLL to deal with how you manage the structure.

As George Tasker pointed out, you might look at Paul Tatavu's POINTERS class, or my CLSHEAP class, both available for download here on UT from the Files section, to see a couple of different approaches to handling the memory management issues involved with passing and parsing structures. There are various samples of code using both classes to handle construction and interpretation of various structures posted in the FAQ or various files on UT; in the case of CLSHEAP, I've posted an additional file called NETRSC.ZIP that implements the NETRESOURCE structure in detail in a class, using CLSHEAP to provide the heap management facilities needed to manipulate the NETRESOURCE structure.
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