|
-
Jan 2nd, 2005, 09:55 AM
#1
Thread Starter
Addicted Member
RasDialDlg API
heylo, i want to use the RasDialDlg api, the purpose of this API is to establish a RAS connection n it gives the status window like when we dial in windows, Port Opening, then Dialing then, Authenticating .......
the code i have implemented does'nt do nething, it actually doesn't dial the number even. here is the code
Declaration:
Public Declare Function RasDialDlg Lib "rasdlg.dll" Alias "RasDialDlgA" (ByVal lpszPhonebook As String, ByVal lpszEntry As String, ByVal lpszPhoneNumber As String, lpInfo As LPRASDIALDLG) As Boolean
Public Type LPRASDIALDLG
dwSize As Long
hwndOwner As Long 'IN HWND hwndOwner;
dwFlags As Long
xDlg As Long
yDlg As Long
dwSubEntry As Long
dwError As Long
reserved As Long
reserved2 As Long
End Type
Code:
Dim lpInfo As LPRASDIALDLG
lpInfo.dwSize = Len(lpInfo) + 4
lpInfo.hwndOwner = Me.hwnd
'lpInfo.dwFlags =
'lpInfo.xDlg = 0
'lpInfo.yDlg
lpInfo.dwSubEntry = 0
'lpinfo.dwError =
lpInfo.reserved = 0
lpInfo.reserved2 = 0
b = RasDialDlg("", "Gerrys", "", lpInfo)
--------
the parameters i gave to the function call are first of all a phone book file which if null takes the default RASPHONE in system folder, the next is the phone entry name which is Gerrys n is present in the RASPHONE.pbk, the next argument is phone number which i dun need to override n take from the phone entry n da last parameter is reference to LPRASDIALDLG
the only problem i guess is that i havent declared the type struct well, because am newbee in vb, i saw it on msdn it had different data types n i din't know the perfect conversion for each, so i took each one jus as Long.
pls help me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|