Re: Telefonnummer aus einer VB-Anwendung wählen
- From: "Christoph Marx" <muelleimer@xxxxxx>
- Date: Thu, 10 Aug 2006 10:50:08 +0200
Wilfried Dietrich schrieb:
...
Hmmm, na ja vielleicht postest du ja einige Code-Fragmente die ich dann
verwenden kann bzw. mit denen ich dann weiter denken kann.
...
Hier der Code für den Umgang mit der Capi. Damit lässt sich sich eine
assoziierte Wahl durchführen und die Events der Capi debuggen. Erstell dir
einfah ein Projekt mit einer capi-anruf.frm und einer capi-anruf.bas auf
einem Rechner mit capi.dll (zb.B. von AVM). Habe im Moment keinen Rechner
mit Capi zur Verfügung, so dass ich den Code nicht testen konnte, sollte
aber funktionieren oder zumindest den Weg zeigen.
capi-anruf.bas:
Option Explicit
'Generell Verwendete Variablen
Public Appid As Long, PLCI As Long
Public lpCapiBuffer As Long
Public msg$, proz As Boolean
Public gerufenenummer$, a$
Public Const maxLogicalConnection As Long = 2
Public Const MessageBuffersize As Long = 1024 + (1024 *
maxLogicalConnection)
Public Const maxBDataBlocks As Long = 7
Public Const maxBDataLen As Long = 2048
Public Const HeaderLength As Long = 8
'CAPI
Declare Function CAPI_REGISTER Lib "Capi2032.dll" (ByVal D_MessageBuffersize
As Long, ByVal D_maxLogicalConnection As Long, ByVal D_maxBDataBlocks As
Long, ByVal D_maxBDataLen As Long, ByRef D_AppID As Long) As Long
Declare Function CAPI_RELEASE Lib "Capi2032.dll" (ByVal D_AppID As Long) As
Long
Declare Function CAPI_WAIT_FOR_SIGNAL Lib "Capi2032.dll" (ByVal D_AppID As
Long) As Long
Declare Function CAPI_PUT_MESSAGE Lib "Capi2032.dll" (ByVal D_AppID As Long,
pcapimessage As Any) As Long
Declare Function CAPI_GET_MESSAGE Lib "Capi2032.dll" (ByVal D_AppID As Long,
ByRef lpCapiBuffer As Long) As Long
Declare Sub RtlMoveMemory Lib "Kernel32.Dll" (lpRecieve As Any, ByVal
lpCapiBuffer As Long, ByVal iMaxLength As Long)
'----- CAPI commands -----
Public Const CAPI_ALERT = &H1
Public Const CAPI_CONNECT = &H2
Public Const CAPI_CONNECT_ACTIVE = &H3
Public Const CAPI_CONNECT_B3_ACTIVE = &H83
Public Const CAPI_CONNECT_B3 = &H82
Public Const CAPI_CONNECT_B3_T90_ACTIVE = &H88
Public Const CAPI_DATA_B3 = &H86
Public Const CAPI_DISCONNECT_B3 = &H84
Public Const CAPI_DISCONNECT = &H4
Public Const CAPI_FACILITY = &H80
Public Const CAPI_INFO = &H8
Public Const CAPI_LISTEN = &H5
Public Const CAPI_MANUFACTURER = &HFF
Public Const CAPI_RESET_B3 = &H87
Public Const CAPI_SELECT_B_PROTOCOL = &H41
'----- CAPI subcommands -----
Public Const CAPI_REQ = &H80
Public Const CAPI_CONF = &H81
Public Const CAPI_IND = &H82
Public Const CAPI_RESP = &H83
'-----------------------------------------------
'from Capi always subcommand Conf or Ind
'to Capi always Req or Resp
'-----------------------------------------------
'structured Messages to CAPI with header
'-----------------------------------------------
'Messages from CAPI uses this header
Public Type MessageHeader
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
End Type
Public MessageHeader As MessageHeader
'-----------------------------------------------
Public Type AlertREQ
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
PLCI As Long
'ab hier immer 0 eintragen
BCI As Integer
kpf As Byte
uud As Byte
fda As Byte
End Type
Public AlertREQ As AlertREQ
'-----------------------------------------------
Public Type AlertConf
PLCI As Long
info As Integer
End Type
Public AlertConf As AlertConf
'-----------------------------------------------
Public Type Connect_Req
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
MessageNumber As Integer
Controller As Long
CIP As Integer
CalledNumberLen As Byte
CalledNumber As String * 20
CallingNumberLen As Byte
CallingNumber As String * 8
CalledSub As Byte
CallingSub As Byte
BProt As Byte
BC As Byte
LLC As Byte
HLC As Byte
AdditionalInfo As Byte
End Type
Public Connect_Req As Connect_Req
'-----------------------------------------------
Public Type ConnectConf
PLCI As Long
info As Integer
End Type
Public ConnectConf As ConnectConf
'-----------------------------------------------
Public Type ConnectInd
PLCI As Long
CIP As Integer
buffer As String * 100
End Type
Public ConnectInd As ConnectInd
'-----------------------------------------------
Public Type ConnectResp
Length As Integer
Appid As Integer
Message_Number As Byte
Command As Byte
Subcommand As Byte
PLCI As Long
Reject As Integer
BProtocol As Long
ConnectedNumber As Long
ConnectedSubaddress As Long
LLC As Byte
'LLC As Long
'AdditionalInfo As Long
AdditionalInfo As Byte
End Type
Public ConnectResp As ConnectResp
'-----------------------------------------------
Public Type ConnectActiveInd
PLCI As Long
buffer As String * 100
End Type
Public ConnectActiveInd As ConnectActiveInd
'-----------------------------------------------
Public Type ConnectActiveResp
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
PLCI As Long
'buffer As String * 100
End Type
Public ConnectActiveResp As ConnectActiveResp
'-----------------------------------------------
Public Type ConnectB3Ind
NCCI As Long
NCPI As String * 100
End Type
Public ConnectB3Ind As ConnectB3Ind
'-----------------------------------------------
Public Type ConnectB3Resp
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
NCCI As Long
Reject As Integer
NCPI As Byte
End Type
Public ConnectB3Resp As ConnectB3Resp
'-----------------------------------------------
Public Type DisconnectReq
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
PLCI As Long
b1 As Byte
End Type
Public DisconnectReq As DisconnectReq
'-----------------------------------------------
Public Type DisconnectInd
PLCI As Long
Reason As Integer
End Type
Public DisconnectInd As DisconnectInd
'-----------------------------------------------
Public Type DisconnectConf
PLCI As Long
info As Integer
End Type
Public DisconnectConf As DisconnectConf
'-----------------------------------------------
Public Type DisconnectResp
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
PLCI As Long
End Type
Public DisconnectResp As DisconnectResp
'-----------------------------------------------
Public Type FacilityReq
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
PLCI As Long
b1 As String * 20
End Type
Public FacilityReq As FacilityReq
'-----------------------------------------------
Public Type FacilityConf
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
Function As Integer
buffer As String * 100
End Type
Public FacilityConf As FacilityConf
'-----------------------------------------------
Public Type InfoReq
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end -------
PLCI As Long
CalledPartyNumber As String
AdditionalInfo As String
End Type
Public InfoReq As InfoReq
'-----------------------------------------------
Public Type InfoConf
PLCI As Long
info As Integer
End Type
Public InfoConf As InfoConf
'-----------------------------------------------
Public Type InfoInd
PLCI As Long
InfoNumber As Integer
InfoElement As String * 100
End Type
Public InfoInd As InfoInd
'-----------------------------------------------
Public Type InfoResp
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
'Header end
PLCI As Long
End Type
Public InfoResp As InfoResp
'-----------------------------------------------
Public Type ListenConf
Controller As Long
info As Integer
End Type
Public ListenConf As ListenConf
'-----------------------------------------------
Public Type ListenREQ
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
Controller As Long
InfoMask As Long
CIPMask As Long
CIPMas2 As Long
CallingParty As Byte
CallingPartySub As Byte
End Type
Public ListenREQ As ListenREQ
'-----------------------------------------------
Public Type ManufactReq
Length As Integer
Appid As Integer
Command As Byte
Subcommand As Byte
Message_Number As Integer
Controller As Long
ManuIdb1 As Byte
ManuIdb2 As Byte
ManuIdb3 As Byte
ManuIdb4 As Byte
ManuMon1 As Byte
ManuMon2 As Byte
b1 As Byte
b2 As Byte
b3 As Byte
b4 As Byte
b5 As Byte
b6 As Byte
b7 As Byte
b8 As Byte
End Type
Public ManufactReq As ManufactReq
'-----------------------------------------------
Public Type ManufactConf
Controller As Long
ManuId As Long
ManuData As String * 20
End Type
Public ManufactConf As ManufactConf
Public Function Info_Number_Evaluation$(InfoNumber)
'If Bit 15 set to 1 then
'/*-- informative values (corresponding message was processed) -----*/
Select Case InfoNumber
Case &H1: Info_Number_Evaluation$ = "NCPI not supported by current
protocol, NCPI ignored"
Case &H2: Info_Number_Evaluation$ = "Flags not supported by current
protocol, flags ignored"
Case &H3: Info_Number_Evaluation$ = "Alert already sent by another
application"
'/*-- error information concerning CAPI_REGISTER -----*/
Case &H1001: Info_Number_Evaluation$ = "Too many applications"
Case &H1002: Info_Number_Evaluation$ = "Logical block size to small,
must be at least 128 Bytes"
Case &H1003: Info_Number_Evaluation$ = "Buffer exceeds 64 kByte"
Case &H1004: Info_Number_Evaluation$ = "Message buffer size too small,
must be at least 1024 Bytes"
Case &H1005: Info_Number_Evaluation$ = "Max. number of logical
connections not supported"
Case &H1006: Info_Number_Evaluation$ = "Reserved"
Case &H1007: Info_Number_Evaluation$ = "The message could not be
accepted because of an internal busy condition"
Case &H1008: Info_Number_Evaluation$ = "OS resource error (no memory ?)"
Case &H1009: Info_Number_Evaluation$ = "CAPI not installed"
Case &H100A: Info_Number_Evaluation$ = "Controller does not support
external equipment"
Case &H100B: Info_Number_Evaluation$ = "Controller does only support
external equipment"
'/*-- error information concerning message exchange functions -----*/
Case &H1101: Info_Number_Evaluation$ = "Illegal application number"
Case &H1102: Info_Number_Evaluation$ = "Illegal command or subcommand or
message length less than 12 bytes"
Case &H1103: Info_Number_Evaluation$ = "The message could not be
accepted because of a queue full condition !! The error code does not imply
that CAPI cannot receive messages directed to another controller, PLCI or
NCCI"
Case &H1104: Info_Number_Evaluation$ = "Queue is empty"
Case &H1105: Info_Number_Evaluation$ = "Queue overflow, a message was
lost !! This indicates a configuration error. The only recovery from this
error is to perform a CAPI_RELEASE"
Case &H1106: Info_Number_Evaluation$ = "Unknown notification parameter"
Case &H1107: Info_Number_Evaluation$ = "The Message could not be
accepted because of an internal busy condition"
Case &H1108: Info_Number_Evaluation$ = "OS Resource error (no memory ?)"
Case &H1109: Info_Number_Evaluation$ = "CAPI not installed"
Case &H110A: Info_Number_Evaluation$ = "Controller does not support
external equipment"
Case &H110B: Info_Number_Evaluation$ = "Controller does only support
external equipment"
'/*-- error information concerning resource / coding problems -----*/
Case &H2001: Info_Number_Evaluation$ = "Message not supported in current
state"
Case &H2002: Info_Number_Evaluation$ = "Illegal Controller / PLCI /
NCCI"
Case &H2003: Info_Number_Evaluation$ = "Out of PLCI"
Case &H2004: Info_Number_Evaluation$ = "Out of NCCI"
Case &H2005: Info_Number_Evaluation$ = "Out of LISTEN"
Case &H2006: Info_Number_Evaluation$ = "Out of FAX resources (protocol
T.30)"
Case &H2007: Info_Number_Evaluation$ = "Illegal message parameter
coding"
'/*-- error information concerning requested services -----*/
Case &H3001: Info_Number_Evaluation$ = "B1 protocol not supported"
Case &H3002: Info_Number_Evaluation$ = "B2 protocol not supported"
Case &H3003: Info_Number_Evaluation$ = "B3 protocol not supported"
Case &H3004: Info_Number_Evaluation$ = "B1 protocol parameter not
supported"
Case &H3005: Info_Number_Evaluation$ = "B2 protocol parameter not
supported"
Case &H3006: Info_Number_Evaluation$ = "B3 protocol parameter not
supported"
Case &H3007: Info_Number_Evaluation$ = "B protocol combination not
supported"
Case &H3008: Info_Number_Evaluation$ = "NCPI not supported"
Case &H3009: Info_Number_Evaluation$ = "CIP Value unknown"
Case &H300A: Info_Number_Evaluation$ = "Flags not supported (reserved
bits)"
Case &H300B: Info_Number_Evaluation$ = "Facility not supported"
Case &H300C: Info_Number_Evaluation$ = "Data length not supported by
current protocol"
Case &H300D: Info_Number_Evaluation$ = "Reset procedure not supported by
current protocol"
'/*-- informations about the clearing of a physical connection -----*/
Case &H3301: Info_Number_Evaluation$ = "Protocol error layer 1 (broken
line or B-channel removed by signalling protocol)"
Case &H3302: Info_Number_Evaluation$ = "Protocol error layer 2"
Case &H3303: Info_Number_Evaluation$ = "Protocol error layer 3"
Case &H3304: Info_Number_Evaluation$ = "Another application got that
call"
'/*-- T.30 specific reasons -----*/
Case &H3311: Info_Number_Evaluation$ = "Connecting not successful
(remote station is no FAX G3 machine)"
Case &H3312: Info_Number_Evaluation$ = "Connecting not successful
(training error)"
Case &H3313: Info_Number_Evaluation$ = "Disconnected before transfer
(remote station does not support transfer mode, e.g. resolution)"
Case &H3314: Info_Number_Evaluation$ = "Disconnected during transfer
(remote abort)"
Case &H3315: Info_Number_Evaluation$ = "Disconnected during transfer
(remote procedure error, e.g. unsuccessful repetition of T.30 commands)"
Case &H3316: Info_Number_Evaluation$ = "Disconnected during transfer
(local tx data underrun)"
Case &H3317: Info_Number_Evaluation$ = "Disconnected during transfer
(local rx data overflow)"
Case &H3318: Info_Number_Evaluation$ = "Disconnected during transfer
(local abort)"
Case &H3319: Info_Number_Evaluation$ = "Illegal parameter coding (e.g.
SFF coding error)"
'/*-- disconnect causes from the network according to ETS 300
102-1/Q.931 -----*/
Case &H3481: Info_Number_Evaluation$ = "Unallocated (unassigned) number"
Case &H3482: Info_Number_Evaluation$ = "No route to specified transit
network"
Case &H3483: Info_Number_Evaluation$ = "No route to destination"
Case &H3486: Info_Number_Evaluation$ = "Channel unacceptable"
Case &H3487: Info_Number_Evaluation$ = "Call awarded and being delivered
in an established channel"
Case &H3490: Info_Number_Evaluation$ = "Normal call clearing"
Case &H3491: Info_Number_Evaluation$ = "User busy"
Case &H3492: Info_Number_Evaluation$ = "No user responding"
Case &H3493: Info_Number_Evaluation$ = "No answer from user (user
alerted)"
Case &H3495: Info_Number_Evaluation$ = "Call rejected"
Case &H3496: Info_Number_Evaluation$ = "Number changed"
Case &H349A: Info_Number_Evaluation$ = "Non-selected user clearing"
Case &H349B: Info_Number_Evaluation$ = "Destination out of order"
Case &H349C: Info_Number_Evaluation$ = "Invalid number format"
Case &H349D: Info_Number_Evaluation$ = "Facility rejected"
Case &H349E: Info_Number_Evaluation$ = "Response to STATUS ENQUIRY"
Case &H349F: Info_Number_Evaluation$ = "Normal, unspecified"
Case &H34A2: Info_Number_Evaluation$ = "No circuit / channel available"
Case &H34A6: Info_Number_Evaluation$ = "Network out of order"
Case &H34A9: Info_Number_Evaluation$ = "Temporary failure"
Case &H34AA: Info_Number_Evaluation$ = "Switching equipment congestion"
Case &H34AB: Info_Number_Evaluation$ = "Access information discarded"
Case &H34AC: Info_Number_Evaluation$ = "Requested circuit / channel not
available"
Case &H34AF: Info_Number_Evaluation$ = "Resources unavailable,
unspecified"
Case &H34B1: Info_Number_Evaluation$ = "Quality of service unavailable"
Case &H34B2: Info_Number_Evaluation$ = "Requested facility not
subscribed"
Case &H34B9: Info_Number_Evaluation$ = "Bearer capability not
authorized"
Case &H34BA: Info_Number_Evaluation$ = "Bearer capability not presently
available"
Case &H34BF: Info_Number_Evaluation$ = "Service or option not available,
unspecified"
Case &H34C1: Info_Number_Evaluation$ = "Bearer capability not
implemented"
Case &H34C2: Info_Number_Evaluation$ = "Channel type not implemented"
Case &H34C5: Info_Number_Evaluation$ = "Requested facility not
implemented"
Case &H34C6: Info_Number_Evaluation$ = "Only restricted digital
information bearer capability is available"
Case &H34CF: Info_Number_Evaluation$ = "Service or option not
implemented, unspecified"
Case &H34D1: Info_Number_Evaluation$ = "Invalid call reference value"
Case &H34D2: Info_Number_Evaluation$ = "Identified channel does not
exist"
Case &H34D3: Info_Number_Evaluation$ = "A suspended call exists, but
this call identity does not"
Case &H34D4: Info_Number_Evaluation$ = "Call identity in use"
Case &H34D5: Info_Number_Evaluation$ = "No call suspended"
Case &H34D6: Info_Number_Evaluation$ = "Call having the requested call
identity has been cleared"
Case &H34D8: Info_Number_Evaluation$ = "Incompatible destination"
Case &H34DB: Info_Number_Evaluation$ = "Invalid transit network
selection"
Case &H34DF: Info_Number_Evaluation$ = "Invalid message, unspecified"
Case &H34E0: Info_Number_Evaluation$ = "Mandatory information element is
missing"
Case &H34E1: Info_Number_Evaluation$ = "Message type non-existent or not
implemented"
Case &H34E2: Info_Number_Evaluation$ = "Message not compatible with call
state or message type non-existent or not implemented"
Case &H34E3: Info_Number_Evaluation$ = "Information element non-existent
or not implemented"
Case &H34E4: Info_Number_Evaluation$ = "Invalid information element
contents"
Case &H34E5: Info_Number_Evaluation$ = "Message not compatible with call
state"
Case &H34E6: Info_Number_Evaluation$ = "Recovery on timer expiry"
Case &H34EF: Info_Number_Evaluation$ = "Protocol error, unspecified"
Case &H34FF: Info_Number_Evaluation$ = "Interworking, unspecified"
Case Else: Info_Number_Evaluation$ = "No additional information"
End Select
' TextView Info_Number_Evaluation$
End Function
capi-anruf.frm:
beinhaltet folgende Objekte (Art des Objektes; Name; Kommentar)
TextBox; txtMSN; zur Eingabe der MSN, auf die der Anruf erfolgen soll
TextBox; txtNummer; zur Eingabe der Nummer, die gewählt werden soll
CommandButton; cmdAnrufen
Timer; Timer1; Enabled=True, Interval=1000, zur Abfrage der CAPI-Events
Option Explicit
Dim msgnr As Integer
Public Sub Get_Capi_Message()
proz = True
Dim x As Long, l1 As Integer, l2 As Integer
Dim n As Integer, c As Integer, Reason As String
x = CAPI_GET_MESSAGE(ByVal Appid, lpCapiBuffer)
If x <> 0 Then Exit Sub
'Message in eine VB-Struktur kopieren
Call RtlMoveMemory(MessageHeader, ByVal lpCapiBuffer, ByVal
HeaderLength)
Debug.Print Hex$(MessageHeader.Command), Hex$(MessageHeader.Subcommand)
'anhand von MessageHeader.Command und MessageHeader.Subcommand kann
'man nun erkennen, welche Message die Capi geschickt hat.
Select Case MessageHeader.Command
Case CAPI_CONNECT
If MessageHeader.Subcommand = CAPI_CONF Then 'Antwort der CAPI auf
Connect-REQ
Call RtlMoveMemory(ConnectConf, ByVal (lpCapiBuffer +
HeaderLength), ByVal (MessageHeader.Length - HeaderLength))
PLCI = ConnectConf.PLCI
End If
Case CAPI_INFO
If MessageHeader.Subcommand = CAPI_IND Then 'Meldung der CAPI:
Verbindung beendet
With InfoResp
.Length = Len(InfoResp)
.Appid = Appid
.Command = CAPI_INFO
.Subcommand = CAPI_RESP
.Message_Number = &H0
.PLCI = PLCI
End With
x = CAPI_PUT_MESSAGE(ByVal Appid, InfoResp)
End If
Case CAPI_CONNECT_ACTIVE
If MessageHeader.Subcommand = CAPI_IND Then
With ConnectActiveResp
.Appid = Appid
.Command = CAPI_CONNECT_ACTIVE
.Subcommand = CAPI_RESP
.Length = Len(ConnectActiveResp)
.Message_Number = &H0
.PLCI = PLCI
End With
x = CAPI_PUT_MESSAGE(ByVal Appid, ConnectActiveResp)
End If
Case CAPI_DISCONNECT
If MessageHeader.Subcommand = CAPI_IND Then
Call RtlMoveMemory(DisconnectInd, ByVal (lpCapiBuffer +
HeaderLength), ByVal (MessageHeader.Length - HeaderLength))
MsgBox "Verbindung wurde beendet: " &
Info_Number_Evaluation$(DisconnectInd.Reason)
With DisconnectResp
.Length = Len(DisconnectResp)
.Appid = Appid
.Command = CAPI_DISCONNECT
.Subcommand = CAPI_RESP
.Message_Number = &H0
.PLCI = PLCI
End With
x = CAPI_PUT_MESSAGE(ByVal Appid, DisconnectResp)
End If
End Select
proz = False
End Sub
Private Sub cmdAnrufen_Click()
Dim ret As Long
Dim nr as String
msgnr = msgnr + 1
If cmdAnrufen.Caption = "&Anrufen" Then
Connect_Req.Appid = Appid
Connect_Req.Command = CAPI_CONNECT
Connect_Req.Subcommand = CAPI_REQ
Connect_Req.MessageNumber = msgnr
Connect_Req.Controller = &H1
Connect_Req.CIP = 1
Connect_Req.BProt = &H1
Connect_Req.Length = Len(Connect_Req)
'der nachfolgende Aufbau der Rufnummer ist abhängig von der
verwendeten Telefonanlage
nr = "7567" 'das ist der Befehlscode zur Durchführung einer
assoziierten Wahl für Siemens Hicom
nr = nr & "/" & txtMSN.Text 'die MSN, auf die den Anruf bekommt
nr = nr & "/0" & txtNummer.Text 'die Null zur Amtsholung und die
anzurufende Telefonnummer
Connect_Req.CalledNumberLen = Len(nr) + 1
Connect_Req.CalledNumber = Chr$(&H80) + nr
Connect_Req.CallingNumberLen = Len(Trim(txtMSN.Text)) + 2
'Connect_Req.CallingNumber = Chr$(0) + Chr$(128) + Trim(txtMSN.Text)
Connect_Req.CallingNumber = Chr$(&H0) + Trim(txtMSN.Text)
Connect_Req.CalledSub = &H0
Connect_Req.CallingSub = &H0
Connect_Req.BC = &H0
Connect_Req.LLC = &H0
Connect_Req.HLC = &H0
Connect_Req.AdditionalInfo = &H0
ret = CAPI_PUT_MESSAGE(ByVal Appid, Connect_Req)
cmdAnrufen.Caption = "&Trennen"
ElseIf cmdAnrufen.Caption = "&Trennen" Then
DisconnectReq.Appid = Appid
DisconnectReq.Command = CAPI_DISCONNECT
DisconnectReq.Subcommand = CAPI_REQ
DisconnectReq.Length = Len(DisconnectReq)
DisconnectReq.Message_Number = msgnr
DisconnectReq.PLCI = PLCI
ret = CAPI_PUT_MESSAGE(ByVal Appid, DisconnectReq)
cmdAnrufen.Caption = "&Anrufen"
End If
End Sub
Private Sub Form_Load()
msgnr = 0
Dim x As Long, f As Boolean
'Bei der Capi anmelden (ist immer notwendig)
x = CAPI_REGISTER(MessageBuffersize, maxLogicalConnection,
maxBDataBlocks, maxBDataLen, Appid)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim x As Long
'Bei der Capi abmelden (immer erforderlich)
x = CAPI_RELEASE(Appid)
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim x As Long
'Bei der Capi abmelden (immer erforderlich)
x = CAPI_RELEASE(Appid)
End Sub
Private Sub Timer1_Timer()
'Im 1-Sekunden-Abstand Capi-Messages abrufen
Call Get_Capi_Message
End Sub
.
- Follow-Ups:
- Re: Telefonnummer aus einer VB-Anwendung wählen
- From: Wilfried Dietrich
- Re: Telefonnummer aus einer VB-Anwendung wählen
- References:
- Telefonnummer aus einer VB-Anwendung wählen
- From: Wilfried Dietrich
- Re: Telefonnummer aus einer VB-Anwendung wählen
- From: Christoph Marx
- Re: Telefonnummer aus einer VB-Anwendung wählen
- From: Wilfried Dietrich
- Re: Telefonnummer aus einer VB-Anwendung wählen
- From: Christoph Marx
- Re: Telefonnummer aus einer VB-Anwendung wählen
- From: Wilfried Dietrich
- Telefonnummer aus einer VB-Anwendung wählen
- Prev by Date: Re: listview spaltenweise(!) füllen
- Next by Date: Re: Richtigen Variant-Typ aus VarType erzeugen
- Previous by thread: Re: Telefonnummer aus einer VB-Anwendung wählen
- Next by thread: Re: Telefonnummer aus einer VB-Anwendung wählen
- Index(es):
Relevant Pages
|