Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help - How to get Dial-up conections instaled
Message
From
05/07/2001 11:04:36
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Help - How to get Dial-up conections instaled
Miscellaneous
Thread ID:
00526973
Message ID:
00526973
Views:
54
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
Map
View

Click here to load this message in the networking platform