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

程序系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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值