您的位置:首页 > 其它

在palm os4上面调用telephone library打电话

2005-12-06 20:59 141 查看
程序系Hand-Held Basic ++ 1.05源代码

Private Const sysLibTrapBase as Long = &HA800
Private Const sysLibTrapName as Long = &HA800
Private Const sysLibTrapOpen as Long = &HA801
Private Const sysLibTrapClose as Long = &HA802
Private Const sysLibTrapSleep as Long = &HA803
Private Const sysLibTrapWake as Long = &HA804
Private Const sysLibTrapCustom as Long = &HA805
Public Declare Function TelOpen(ByVal refnum as Integer, Byval vernum as Long, Byref appid as Long) as Integer Trap sysLibTrapOpen
Public Declare Function TelClose (ByVal refnum as Integer, Byval appid as Long) as Integer Trap sysLibTrapClose
Public Declare Function TelSpcCallNumber(Byval refnum as Integer, Byval appid as Long, Byval dialnumber as String, byref transid as Integer) as Integer Trap &HA842
Public Declare Function TelSpcCloseLine(byval refnum as Integer, byval appid as Long, byval lineid as Integer, byref transid as Integer) as Integer Trap &HA843

Public Declare Sub WinDrawPixel(ByVal x as Integer, ByVal y as Integer) Trap &HA383
Public Declare Sub WinGetPixelRGB(ByVal x as Integer, ByVal y as Integer, ByRef rgb as Long) Trap &HA3EB
Public Declare Function WinSetDrawWindow(ByVal hWin as Long) As Pointer Trap &HA1FD
Public lappid as Long
Public iRefNum as integer
Public tranid as Integer
Public Sub TelInit()
Dim e as Integer
On error goto Err_MLInit
' Load MathLib, obtain a reference number
' and initialize the library
iRefNum=LoadLibrary("PhoneLib.lib","libr", "tmgr")
e=TelOpen(iRefNum,16982016,lappid)
If e<>0 Then Err.Raise 67
Exit Sub
Err_MLInit:
MsgBox "Error # " & Err.Number & "/n" & Err.Description
App.Quit
End Sub
'---------------------------- Close the library ----------------
Public Sub TelTermin()
Dim e as Integer, u as Integer
' If the library was opened and is no longer
' used, unload it
If iRefNum<>0 Then
e=TelClose(iRefNum,lappid)
'u contains the number of other applications using the library
'If e<>63 Then RemoveLibrary(iRefNum)
End If
End Sub
Public Sub SpeechDial()
Dim e as Integer
e=TelSpcCallNumber(iRefNum,lappid,"1860",tranid)
msgbox cstr(e)
End Sub
Public Sub CloseDial()
Dim e as Integer
e=TelSpcCloseLine(iRefNum,lappid,0,tranid)
msgbox cstr(e)
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: