General information
Category:
Windows API functions
Title:
Help - How to get Dial-up conections instaled
In a function I want to return all the Dial-up conections instaled to an array, so user can select which one to use.
To get all Dial-up entries instaled I use RasEnumEntries function (RAS32 API) that works fine in Win95/98 but doesnt work in Win2K-Pro + SP2.(VFP 6.0 + SP5)
The code....
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 Win95/98 *** works fine.
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
----
FUNCTION F_WORDTOC(xnumero)
RETURN CHR(BITAND(255,xnumero)) ;
+CHR(BITAND(65280,xnumero)%255) ;
+CHR(BITAND(16711680,xnumero)%255) ;
+CHR(BITAND(4278190080,xnumero)%255)
ENDFUNC
* nResult value in Win95/98 is 0, but in Win2K-Pro nResult value is 261
The RasEnumEntries function is used to enumerate a list of phone-book entries.
Unfornatelly it work's only in Win95/98 and not in Win2K-Pro, so... Does someone knows another way
to get the list of phone-book entries, or a way to solve this problem in Win2K-Pro ?
Please, I need HELP....
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