Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting data structures in DLL calls
Message
From
19/09/2003 11:23:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00830675
Message ID:
00830682
Views:
24
>Hi,
>I'm trying to call a DLL routine that uses the following data structure (in VB) as one of the parameters:
>
>
>Type WSADATA
>    wversion As Integer
>    wHighVersion As Integer
>    szDescription(0 To 256) As Byte
>    szSystemStatus(0 To 128) As Byte
>    iMaxSockets As Integer
>    iMaxUpdDg As Integer
>    lpszVendorInfo As Long
>End Type
>
>
>When I look through the VFP8 documentation, I see that I must convert this structure to the equivalent string value. Okay, that makes sense. However, I'm not sure of the lengths of the values. How long is the string equivalent of an Integer value? How long is the string equivalent of a Long value? I'm assuming that the szDescription and szSystemStatus values would simply be regular strings with lengths of 256 and 128 respectively. Can anyone help me out with this?
>
>John

John,
From windows SDK aspect an integer and long are both 32 bits signed values (4 bytes). However if your structure is from VBA then VBA uses integer for short ( 16 bits - 2 bytes) and long for integer (32 bits - 4 bytes).
I'd simply set both as 4 bytes and check results.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform