拨号网络的API函数是什么?

wzt3104 2003-05-14 01:25:59
在VB6.0中(2000系统)怎么调用拨号网络的API函数?使其能够自动进行拨号?大家帮帮忙。说声谢谢了。
...全文
58 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lihonggen0 2003-05-15
  • 打赏
  • 举报
回复

'Author comments: I often get asked the question "How can
'I dial a phone number from VB?". Well, you can add
'the MSCOMM32.OCX control to a form but that isn't necessary
'if you just want to dial a phone number.
Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal Dest As String, ByVal AppName As String, ByVal CalledParty As String, ByVal Comment As String) As Long
Private Sub PhoneCall(sNumber As String, sName As String)
Dim lRetVal As Long
lRetVal = tapiRequestMakeCall(Trim$(sNumber), App.Title, Trim$(sName), "")
If lRetVal <> 0 Then
'Couldn't make the call.
'Take appropriate action
End If
End Sub
Private Sub Form_Load()
PhoneCall "123456", "TheName"
End Sub
sxs69 2003-05-14
  • 打赏
  • 举报
回复
利用 API 可以直接拨号
声明:
Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal DestAddr$, ByVal AppName As String, ByVal CalledParty As String, ByVal Comment As String) As Long
例子:
Public Sub CallPhone(Number As String, Name As String)
 Dim lRes As Long
 If (Trim(Number) = "") Then
  Exit Sub
 End If
 If (MsgBox("About to call " & Trim(Name) & " at phone number " & Trim(Number) & vbCrLf & "Do it?", vbYesNo, App.Title) = vbYes) Then
  lRes = tapiRequestMakeCall(Trim(Number), App.Title, Trim(Name), "")
  Debug.Print Now; " CallPhone -> tapiRequestMakeCall Result code = "; lRes
 End If
End Sub

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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