General information
Category:
Windows API functions
Title:
Problems with RAS 32 API in Win2K
I have a function to return all the Dial_up conections instaled to an array, so user can select which he/she want to use to send/receive mail/files, etc...
I use a RAS32 API that works in Win95/98 but doesnt work in Win2000.
Could someone help me to solve this problem, or another Sample that works.
The code.
Function F_DIALDISPO
DECLARE INTEGER RasEnumEntries ;
IN RASAPI32.DLL ;
INTEGER reserved, ;
STRING PhoneBox, ;
STRING @ RasEntryName, ;
INTEGER @ SizeOfRasEntryName, ;
INTEGER @ Entries
LOCAL cStructRasEntryName
LOCAL cStructRasEntryNames, nSize
LOCAL nEntries, nResult, cRasEntryName
#DEFINE RAS_MAXENTRYNAME 256
cStructRasEntryName = F_WORDTOC(264)+ REPLICATE( CHR(0), RAS_MAXENTRYNAME )
cArrayRasEntryNames = REPLICATE( cStructRasEntryName, 255 )
nSize = LEN( cArrayRasEntryNames )
nEntries = 0 && Variable to store number of entries found
*** problem is here, in win2K nEntries return's allways 0(zero) but in Win9x works fine.
*** call function to get information
nResult = RasEnumEntries( 0, "", @cArrayRasEntryNames, @nSize, @nEntries )
PUBLIC ARRAY &cArrayReturn.[nEntries]
FOR nCont = 0 TO nEntries - 1
cRasEntryName = SUBSTR(cArrayRasEntryNames, 264*nCont + 1, 264)
&cArrayReturn.[nCont+1] = SUBSTR(cRasEntryName,5,AT(CHR(0),SUBSTR(cRasEntryName,5))-1)
NEXT
RETURN nEntries
ENDFUNC
------------------
Thanks in Advance
Peter
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only