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

来源:互联网 发布:js 遍历对象中的属性 编辑:程序博客网 时间:2024/05/14 05:26

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

原创粉丝点击