Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with RAS 32 API in Win2K
Message
From
04/07/2001 17:27:08
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
04/07/2001 17:24:16
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00526774
Message ID:
00526775
Views:
18
Ops.. forgot another function..
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


*** call function to get information
nResult = RasEnumEntries( 0, "", @cArrayRasEntryNames, @nSize, @nEntries )
*** problem is here, in win2K nEntries return's allways 0(zero) but in Win9x works fine.


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

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

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


======

Thanks in Advance
Peter
Previous
Reply
Map
View

Click here to load this message in the networking platform