General information
Category:
Windows API functions
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
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