Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with RAS 32 API in Win2K
Message
 
 
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:
00526776
Views:
15
Just a guess, maybe a user doesn't have enough rights?
Did you try to run your code under the Admin account?


>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform