Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of bytes of types declare in VB
Message
From
30/06/1999 10:51:35
 
 
To
30/06/1999 10:18:07
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00235733
Message ID:
00235924
Views:
23
>George,
>
>It's the crPESelectPrinter(njob,cdriver,cPrinter,cPort,@crdevmode) API for crystal reports. This is a VB function which has to be translated to VFP, The last crDevmode parameter can contain some info which is originally stored in a VB structure.
>

The odds are that you'll have to construct the crdevmode structure either in a VFP string, or in a static buffer allocated using something like Paul Tatavu's POINTERS class or my CLSHEAP class. In order to know which is needed, you'd have to describe the VB structure declaraction (or in my case, I'd prefer a C typedef.) If there are any pointers to strings in the structure you create, you'll need to construct a static buffer to hold them, since you'll have to embed pointers to the string space in the structure, and VFP can (and frequently does) move things around in memory on its own.

>Because I've got to know at which position i've got to poke my info in. Fortunately I did figure it out by trying. It seems that both INTEGER and LONG are 4 bytes long, only the order of the bytes seems to be different.
>
>Now i'm facing a new problem (Sighhhhh): How do you translate an ANY datatype as an argument in a API call ?
>

If the function is really designed to accept a VB variant datatype as input, you might consider creating a COM wrapper written in VB to connect VFP to the API; the details of translating variants are not trivial. If the ANY simply means that a pointer to an arbitrary structure is passed, then you'll be able to use a VFP string or static buffer as mentioned above.

>Walter,
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