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 11:57:25
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00235733
Message ID:
00235967
Views:
30
Ed,

BTW, I glad too see we can face eachother again in a professional way.

>>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.

I used the VFP string method which works fine. The only problem have with this is that you've to find out which position is referring to what data. But I you've done this, it's very efficient.

>>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.

I did come across an example on the seagate site which showed that this any type could be replaced by a string, integer etc, whatever what was applicable.



Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform