Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Type structure declaration in VFP
Message
From
25/09/2002 20:04:23
 
 
To
25/09/2002 11:04:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00704257
Message ID:
00704523
Views:
18
>I've been trying to convert the following type structure declaration to Visual FoxPro but I can't get it to work:
>
>Public Type RasConn
> dwSize As Long
> hRasConn As Long
> szEntryName(RAS_MAXENTRYNAME) As Byte
> szDeviceType(RAS_MAXDEVICETYPE) As Byte
> szDeviceName(RAS_MAXDEVICENAME) As Byte
>End Type
>
>Anyone has any idea how to do the convertion??
>
>Thanks in advance!

Victor,

In addition to Sergey, many structure type of API can be call with NULL or 0 so you don't have to worry about convertion
Try this:
Declare Integer RasEnumConnections in RasAPI32; 
    String @lpRASCONN, Integer @nSize, Integer @nCountConn

lcBuffer = chr(0)
Store 0 to nSize, nCount
RasEnumConnections(@lcBuffer, @nSize, @nCount)   && Get RASCONN size
If (nCount > 0)
   lcBuffer = Num2DWord(nSize) + replicate(chr(0), nSize - 4)
endif
RasEnumConnections(@lcBuffer, @nSize, @nCount)
?strtran(substr(lcBuffer,   9, 256), chr(0),"") 
?strtran(substr(lcBuffer, 266 , 17), chr(0),"") 
?strtran(substr(lcBuffer, 284, 128), chr(0),"") 
HTH
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform