Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List of Dial-Up Connections
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00146361
Message ID:
00146747
Views:
18
>>Hi all,
>>
>>I am trying to create a routine that will gather the list of dial-up connections. The only way that I think this can be done is through API calls. I found two functions in ADVAPI32.DLL that should do the trick, but I haven't been able to get them to work.
>>
>>Here is my current code. If anyone can point out any problems or another way to do this, I would appreciate it.
>>
>>DECLARE RegOpenKeyEx IN ADVAPI32.DLL INTEGER, STRING, INTEGER, ;
>> INTEGER nAccess, INTEGER @nKeyHandle
>>DECLARE RegEnumKeyEx IN ADVAPI32.DLL INTEGER nKeyHandle, ;
>> INTEGER iValue, STRING @lpszName, INTEGER @lpcchName, INTEGER, ;
>> STRING @lpszClass, STRING @lpcchClass, INTEGER @lpftLastWrite
>>
>>nKeyHandle = 0
>>RegOpenKeyEx(2147483649,"RemoteAccess\Profile",0,8,@nKeyHandle)
>>
>>iValue = 0
>>STORE SPACE(255) TO lpszName, lpszClass, lpcchClass
>>STORE 255 TO lpcchName, lpftLastWrite
>>RegEnumKeyEx(nKeyHandle,iValue,@lpszName,@lpcchName,0,@lpszClass,@lpcchClass,@lpftLastWrite)
>
>Brien,
>I am by far not one that can do this reading the registry, I'm just telling you what I know. I have both Mabry and Catalyst ActiveX controls. Using Mabry's Ras control - phone entries can be obtained using the included properties. The catch all - is that for NT - you need to get the entries from the .pbk file. By default this file is located in the \winNT\system32\Ras\rasphone.pbk. (You can have more than one .pbk file - but that is the default.)
>
>I know that doesn't help what you are attempting to do, but it may be helpful.
>(IF you purchase the RAS control from Mabry - I Do have some code that can help)
>Robert

Robert,

Thanks for your reply.

Just in case you're interested, I determined what I was doing wrong. The second last parameter of RegEnumKeyEx (lpcchClass) should be INTEGER not STRING. Once I made that change (and set lpcchClass to 255), everything worked fine.
Brien R. Givens

Brampwood Systems
Previous
Reply
Map
View

Click here to load this message in the networking platform