|
-
Jul 28th, 2001, 05:07 PM
#1
Thread Starter
Addicted Member
Proper TYPE usage (WSADATA)
The following is from Microsoft:
typedef struct WSAData {
WORD wVersion;
WORD wHighVersion;
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATUS_LEN+1];
unsigned short iMaxSockets;
unsigned short iMaxUdpDg;
char FAR * lpVendorInfo;}
I realize that WinSock 2 no longer utilizes iMaxSockets, iMaxUdpDg, and lpVendorInfo, however, the discussion applies to other structures as well.
Not the main question ... I've noticed some people using "As LONG" for iMaxSockets and iMaxUdpDg. Should these not be "As INTEGER"?
I've noticed some use "szDescription(0 to 256) As BYTE" and others use "szDescription As STRING * 257". Firstly, they both seem to work - so which is more proper or more stable? (if that means anything). They definitelly produce different sized structures - "As STRING" results in two bytes per character - which is not what we want. However, it works. Why? Either VB converts STRING to singlebyte chartacters before calling DLL's or the DLL itself recognizes it and handles it. This brings us to our stability question regarding OTHER structures - generally speaking is it better to use BYTE or STRING - perhaps one is more efficient because VB/DLL don't have to convert? (Certainly STRING can be handier in VB).
Many Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|