|
-
Aug 2nd, 2004, 12:44 AM
#1
Thread Starter
New Member
active x control problem
Hello there guys im a newbie in visual basic my boss purchase a Predictive Phone Dialer sample program from Calltrol which include the OTSClient Control component. Everytime i run the sample program they provided, the program runs/works.
The problem is when I add the control they provided and test my program does not work....even if i try to copy the forms and test it, it display a msg " Compile error: Method or data member not found". Even I copy there sample program i have no luck in runnung it succesfully. I have already registered all necessary OCX and DLL.
Pls Help me Pls!!!!! thanks in advance.
Here is my code:
//form SVRConnect//
Option Explicit
Private Sub cmdConnect_Click()
If txthostName = "" Then
MsgBox "Please enter Host name !", vbInformation, "Host name"
txthostName.SetFocus
ElseIf Not IsNumeric(txtPortid) Then
MsgBox "Please enter numeric Port ID !", vbInformation, "Port ID"
txtPortid = ""
txtPortid.SetFocus
ElseIf Not frmDisStr.OTSClient.Init Then
MsgBox "Initialization failed", vbCritical, "Initialization"
Unload Me
ElseIf frmDisStr.OTSClient.Connect(txthostName.Text, CInt(txtPortid.Text)) Then
frmSVRConnect.Hide
frmAgentlogon.show
Else
MsgBox "Connection to " & txthostName & " failed", vbCritical, "Connection"
Unload Me
End If
End Sub
// Code on OTSClient Control component //
Public Event CallArrived(ByVal ProjID As Integer, ByVal CallData As String)
Public Event MsgFrCtrl(ByVal Msg As String)
Private Sub OTSClient_CallArrived(ByVal ProjID As Integer, ByVal CallData As String)
RaiseEvent CallArrived(ProjID, CallData)
End Sub
Private Sub OTSClient_MsgFrCtrl(ByVal Msg As String)
RaiseEvent MsgFrCtrl(Msg)
End Sub
Public Function ChangePartyAttr(CallID As Integer, NewAttribute As Integer) As Integer
ChangePartyAttr = OTSClient.ChangePartyAttr(CallID, NewAttribute)
End Function
Public Function ChgMonitorAttr(AgentID As String, NewAttr As Integer) As Integer
ChgMonitorAttr = OTSClient.ChgMonitorAttr(Agent, NewAttr)
End Function
Public Function Connect(name As String, port As Integer) As Boolean
Connect = OTSClient.Connect(name, port)
End Function
Public Function ConnectCall(clD1 As Integer, clD2 As Integer) As Integer
ConnectCall = OTSClient.ConnectCall(clD1, clD2)
End Function
Public Function ConnectHalfDuplex(CallID1 As Integer, CallID2 As Integer) As Integer
ConnectHalfDuplex = OTSClient.ConnectHalfDuplex(CallID1, CallID2)
End Function
Public Function Delconference(CallID1 As Integer, CallID2 As Integer) As Integer
Delconference = OTSClient.Delconference(CallID1, CallID2)
End Function
Public Function Dial(number As String) As Integer
Dial = OTSClient.Dial(number)
End Function
Public Function DialLocal(number As String) As Integer
DialLocal = OTSClient.DialLocal(number)
End Function
Public Function Disconnect() As Boolean
Disconnect = OTSClient.Disconnect
End Function
Public Function GetAgentCallID(AgentName As String, CallID As Integer) As Integer
GetAgentCallID = OTSClient.GetAgentCallID(AgentName, CallID)
End Function
Public Function GetMsg(s As String, Length As Integer) As Integer
GetMsg = OTSClient.GetMsg(s, Length)
End Function
Public Function hangup() As Integer
hangup = OTSClient.hangup
End Function
Public Function HangupLocal() As Integer
HangupLocal = OTSClient.HangupLocal
End Function
Public Function hold(clD As Integer) As Integer
hold = OTSClient.hold(clD)
End Function
Public Function Init() As Boolean
Init = OTSClient.Init
End Function
Public Function MakeConference(CallD1 As Integer, CallD2 As Integer) As Integer
MakeConference = OTSClient.MakeConference(CallD1, CallD2)
End Function
Public Function MonitorAgent(AgentID As String) As Integer
MonitorAgent = OTSClient.MonitorAgent(AgentID)
End Function
Public Function ready() As Integer
ready = OTSClient.ready
End Function
Public Function retrieve(clD As Integer) As Integer
retrieve = OTSClient.retrieve(clD)
End Function
Public Function SendMsgToCtrl(Messagedata As String, Length As Integer) As Integer
SendMsgToCtrl = OTSClient.SendMsgToCtrl(Messagedata, Length)
End Function
Public Function SetAgentAuxCap(pID As Integer, SkillMask1 As Long, SkillMask2 As Long) As Integer
SetAgentAuxCap = OTSClient.SetAgentAuxCap(pID, SkillMask1, SkillMask2)
End Function
Public Function SetUserData(pID As Integer, vLine As Integer, name As String) As Integer
SetUserData = OTSClient.SetUserData(pID, vLine, name)
End Function
Public Sub ShutDown()
OTSClient.ShutDown
End Sub
Public Function StartVL(AgentID As String, Filename As String, MaxTime As Integer, MaxSilence As Integer) As Integer
StartVL = OTSClient.StartVL(AgentID, Filename, MaxTime, MaxSilence)
End Function
Public Function StopVL(AgentID As String) As Integer
StopVL = OTSClient.StopVL(AgentID)
End Function
Public Function TransferAgent(name As String) As Integer
TransferAgent = OTSClient.TransferAgent(name)
End Function
Public Function UnMonitorAgent(AgentID As String) As Integer
UnMonitorAgent = OTSClient.UnMonitorAgent(AgentID)
End Function
Public Function xdial(Proj As Integer, number As String) As Integer
xdial = OTSClient.xdial(Proj, number)
End Function
Private Sub MsgHook_Message(ByVal MsgId As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal MsgProcessing As Integer, MsgResult As Long)
Dim s As String * 1000
Dim s1 As String
Dim rLen As Integer
If MsgId = &H400 Then
rLen = OTSClient.GetMsg(s, 1000)
If rLen > 0 Then OTSClient.ProcessMsg s, rLen
End If
End Sub
Private Sub UserControl_Initialize()
OTSClient.SetWinTarget hwnd, &H400
MsgHook.AddMessage &H400, 0
MsgHook.hwnd = hwnd
End Sub
Public Sub EnableExMsg()
OTSClient.EnableExMsg
End Sub
Public Function NotReady() As Integer
NotReady = OTSClient.NotReady
End Function
Public Sub ProcessMsg(MsgStr As String, Length As Integer)
OTSClient.ProcessMsg MsgStr, Length
End Sub
Public Sub SetWinTarget(hwnd As Long, ClientMsg As Long)
OTSClient.SetWinTarget hwnd, ClientMsg
End Sub
Public Function CXSendDigits(AgentID As String, Digits As String) As Integer
CXSendDigits = OTSClient.CXSendDigits(AgentID, Digits)
End Function
Public Function SetCallData(CallData As String, Length As Integer) As Integer
SetCallData = OTSClient.SetCallData(CallData, Length)
End Function
Public Function SendStrToCtr(Messagedata As String) As Integer
SendStrToCtr = OTSClient.SendStrToCtr(Messagedata)
End Function
Public Function ProcessMsgEx() As Boolean
ProcessMsgEx = OTSClient.ProcessMsgEx
End Function
Note: when the error msg display it highlight the .Init in SVRConnect form.
Hope anyone there can help me.. thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|