Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When a DLL function expects a 'structure'
Message
From
06/06/1998 00:06:38
 
 
To
05/06/1998 20:23:39
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00105414
Message ID:
00105456
Views:
42
Each TCHAR something[length_in_chars] is an array of characters (8-bit chars in not Unicode or 16-bit chars if Unicode). You can treat each array as a usual string in VFP. The structure RASDIALPARAMS, as a whole, is a concatenation of these arrays plus 2 DWORDS (4-byte unsigned integers). You must know the values of the RAS_blabla, UNLEN, etc constants in order to determine the total length of the structure. When you know the length of each array, just build each string and concatenate them.

For the second question: integers represented in binary format have their bytes in the order reversed to the usual writing. IE: the less representative byte is to the left, the most representative is to the right.

Vlad

>Its the RASDIALPARAMS structure that I am concerned with who's structure is supposed to be
>
>typedef struct _RASDIALPARAMS { DWORD dwSize;
> TCHAR szEntryName[RAS_MaxEntryName + 1];
> TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
> TCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];
> TCHAR szUserName[UNLEN + 1];
> TCHAR szPassword[PWLEN + 1];
> TCHAR szDomain[DNLEN + 1] ;
>#if (WINVER >= 0x401)
> DWORD dwSubEntry;
> DWORD dwCallbackId;
>#endif
>}RASDIALPARAMS;
>
>I'm confused, is that an array or a string? - if its a string how do I represent members of the structure who's values are null such as "CallBackNumber". If you have time could you expand on "byte and word reversal" ?
>
>Many, many thanks !
>Gerry.
>
>
>>>If you are using a Win32 API function that expects a pointer to a structure as >Gerry,
>>
>>Yes build the C struct in a VFP string and send a reference to the string to the DLL. You'll have to make the string byte by byte what the struct internal storage looks like including byte and word reversal for ints.
>
>one of its parameters, how do you create the structure in Fox - do you use an array and then use '@' pointer to character ??
Previous
Reply
Map
View

Click here to load this message in the networking platform