Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I pass a struct (like RECT) to an API function?
Message
From
02/01/1999 13:39:08
 
 
To
02/01/1999 12:33:02
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00172163
Message ID:
00172170
Views:
27
LONG is 4 bytes, WORD is 2 bytes. One byte has 8 bits, so it's easy...

A RECT structure has 4 LONG variables, so, the total length is 4 x 4 = 16 bytes.

You have to convert the 4 numeric values to string (you can find all kind of numeric conversion functions in the NumericConversion class attached to the Pointers class in the files section), concatenate the 4 strings into one and pass this string by reference to the API function.

You can also find numeric conversion functions on David Frankenbach's web site, as well as in many previous messages/threads here on UT.

Vlad

>I want to pass an LPRECT (long pointer to RECT struct) to an API function. What should I do? How can I fill in the values? How do I know how many bytes are needed for 32-bit LONG or 16-bit WORD data type?
>
>Please help.
>
>TIA.
>
>Happy New Year!
Previous
Reply
Map
View

Click here to load this message in the networking platform