谁知道怎么直接调用WINDOWS的拨号网络程序?

happy 2000-06-26 09:53:00
谁知道怎么直接调用WINDOWS的拨号网络程序?

只调用拨号程序,不需要其它......
...全文
328 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
innerboy 2000-06-28
  • 打赏
  • 举报
回复
请这样试一试!
char *dial="rundll32.exe rnaui.dll,RnaDial 中国电信";
WinExec(dial,9);
Un1 2000-06-28
  • 打赏
  • 举报
回复
那就是你的 pText 设置不对。
weixiande 2000-06-28
  • 打赏
  • 举报
回复
到一个能用的RAS控件,千万别用TAPI!切记!!
Un1 2000-06-27
  • 打赏
  • 举报
回复
你先用:

Public Declare Function RasGetErrorString Lib "rasapi32" Alias "RasGetErrorStringA" ( _
ByVal uErrorValue As Long, ByVal lpszErrorString As String, ByVal cBufSize As Long) As Long


Private Function GetErrString(ByVal Number As Long) As String

Dim s As String
s = String(256, 0)

If RasGetErrorString(Number, s, 255) Then
s = "未知错误。"
Else
s = TrimNull(s)
End If

GetErrString = s
End Function

Private Function TrimNull(StrNull As String) As String
Dim l As Long
l = InStr(StrNull, vbNullChar)
If l > 0 Then
TrimNull = Left$(StrNull, l - 1)
Else
TrimNull = StrNull
End If
End Function

查查是什么错误?
茂奇软件 2000-06-27
  • 打赏
  • 举报
回复
use tapi
茂奇软件 2000-06-27
  • 打赏
  • 举报
回复
use TAPI
happy 2000-06-27
  • 打赏
  • 举报
回复
Un1: 你好

为什么总是出错???

typedef LONG (CALLBACK *LPRNADIAL)(HWND,HINSTANCE,LPCTSTR,LONG);

HINSTANCE hdll;
LPRNADIAL RnaDial;
LONG lResult;

hdll=AfxLoadLibrary("rnaui.dll");
if(hdll)
{
RnaDial=(LPRNADIAL)GetProcAddress(hdll,"RnaDial");
if(RnaDial){
lResult = RnaDial(hwnd, hInst, pText, 1);
if(lResult)
AfxMessageBox("error");
}
AfxFreeLibrary(hdll);
}
happy 2000-06-27
  • 打赏
  • 举报
回复
Un1 谢谢你!
开始那个问题已经解决了,错误: "找不到电话簿"

不过我想调用像IE打开时的那个
Un1 2000-06-26
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
On Error GoTo ErrorHandle

Dim l As Long
l = RnaDial(lhWnd, lhInst, Text1, 1)
If l Then
MsgBox "错误: " & l, vbCritical
End If
Exit Sub

ErrorHandle:
MsgBox Err.Description, vbCritical
End Sub
Un1 2000-06-26
  • 打赏
  • 举报
回复
Public Declare Function RnaDial Lib "rnaui.dll" (ByVal hWnd As Long, ByVal hInst As Long, ByVal lpszEntry As String, ByVal lFlag As Long) As Long

18,355

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧