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