半个小时之内。紧急求助版主!(200分)

  • 主题发起人 主题发起人 liangguowei_2
  • 开始时间 开始时间
L

liangguowei_2

Unregistered / Unconfirmed
GUEST, unregistred user!
大家好!
现在我有一个非常重要的问题,就是有个cca.tlb库,我把它import进来之后,可以:
var ACCAServer:ICCAOleServ;
AAgentPhone:IAgentPhone;
AAgentStatistics:IAgentStatistics;
begin
ACCAServer := CreateComObject(CLASS_AgentPhone) as
ICCAOleServ;
AAgentPhone := CreateComObject(CLASS_AgentPhone) as IAgentPhone;
AAgentStatistics := CreateComObject(CLASS_AgentStatistics) as IAgentStatistics;
然后:
可以操作它里面的属性。
但cca.tlb 里面的事件如(onready)等却不知如何去处理它。在vb6里却可以
做到。一点钟之前,就要决定是用delphi4.0 还是vb6.同志们帮帮我!!!

 
实在太紧急,所以我把它cca.tlb贴出来。请大家多多帮助,谢谢!!!

unit CCA_TLB;
// ************************************************************************ //
// Type Lib: C:/Program Files/Alcatel/A4400 CCA/CCA.tlb
// IID/LCID: {0670A181-76C3-11D1-B03F-00A024C4B31A}/0
// Helpfile:
// HelpString:
// Version: 1.0
// ************************************************************************ //

interface

uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used: //
// Type Libraries : LIBID_xxxx //
// CoClasses : CLASS_xxxx //
// DISPInterfaces : DIID_xxxx //
// Non-DISP interfaces: IID_xxxx //
// *********************************************************************//
const
LIBID_CCA: TGUID = '{0670A181-76C3-11D1-B03F-00A024C4B31A}';
DIID_ICCAOleServ: TGUID = '{B99E63F1-8F09-11D1-9072-006008719609}';
DIID_ICCAOleServEvents: TGUID = '{B99E63F3-8F09-11D1-9072-006008719609}';
CLASS_CCAOleServ: TGUID = '{B99E63F2-8F09-11D1-9072-006008719609}';
DIID_IAgentPhone: TGUID = '{B99E6414-8F09-11D1-9072-006008719609}';
DIID_IAgentPhoneEvents: TGUID = '{B99E6418-8F09-11D1-9072-006008719609}';
CLASS_AgentPhone: TGUID = '{B99E6416-8F09-11D1-9072-006008719609}';
DIID_IAgentStatistics: TGUID = '{A4BE6396-925B-11D1-9072-006008719609}';
DIID_IAgentStatisticsEvents: TGUID = '{A4BE639A-925B-11D1-9072-006008719609}';
CLASS_AgentStatistics: TGUID = '{A4BE6398-925B-11D1-9072-006008719609}';
type

// *********************************************************************//
// Forward declaration of interfaces defined in Type Library //
// *********************************************************************//
ICCAOleServ = dispinterface;
ICCAOleServEvents = dispinterface;
IAgentPhone = dispinterface;
IAgentPhoneEvents = dispinterface;
IAgentStatistics = dispinterface;
IAgentStatisticsEvents = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library //
// (NOTE: Here we map each CoClass to its Default Interface) //
// *********************************************************************//
CCAOleServ = ICCAOleServ;
AgentPhone = IAgentPhone;
AgentStatistics = IAgentStatistics;


// *********************************************************************//
// DispIntf: ICCAOleServ
// Flags: (4096) Dispatchable
// GUID: {B99E63F1-8F09-11D1-9072-006008719609}
// *********************************************************************//
ICCAOleServ = dispinterface
['{B99E63F1-8F09-11D1-9072-006008719609}']
property Visible: Smallint dispid 2;
property CCATime: Integer dispid 3;
property PhoneServerOK: WordBool dispid 5;
property StatisticsServerOK: WordBool dispid 6;
property ServiceOption: Integer dispid 7;
property NiceServerOK: WordBool dispid 8;
procedure Quit; dispid 100;
function XShell(const AppName: WideString; const CmdLine: WideString): WordBool; dispid 103;
function XDDEInitiate(const AppName: WideString; const Topic: WideString): Integer; dispid 104;
function XDDETerminate(HConv: Integer): WordBool; dispid 105;
function XDDEExecute(HConv: Integer; const ExecCmd: WideString): WordBool; dispid 106;
function XDDEPoke(HConv: Integer; const Item: WideString; const Data: WideString): WordBool; dispid 107;
function XDDERequest(HConv: Integer; const Item: WideString): WideString; dispid 108;
function XDelay(Seconds: Smallint; DelayID: Smallint): WordBool; dispid 109;
function Trace(const Text: WideString; Data: OleVariant): WordBool; dispid 110;
function SetDateAndTime(const DateAndTime: WideString): WordBool; dispid 111;
end;

// *********************************************************************//
// DispIntf: ICCAOleServEvents
// Flags: (4096) Dispatchable
// GUID: {B99E63F3-8F09-11D1-9072-006008719609}
// *********************************************************************//
ICCAOleServEvents = dispinterface
['{B99E63F3-8F09-11D1-9072-006008719609}']
procedure OnQuit; dispid 1;
procedure OnVisible(Windows: Smallint); dispid 2;
procedure OnServersStatus(Status: Smallint); dispid 3;
procedure OnXDelay(DelayID: Integer); dispid 4;
end;

// *********************************************************************//
// DispIntf: IAgentPhone
// Flags: (4096) Dispatchable
// GUID: {B99E6414-8F09-11D1-9072-006008719609}
// *********************************************************************//
IAgentPhone = dispinterface
['{B99E6414-8F09-11D1-9072-006008719609}']
property Extension: WideString dispid 1;
property LoggedAgent: WideString dispid 2;
property LoggedTeam: WideString dispid 3;
property AgentServiceState: Smallint dispid 4;
property NumberOfConnections: Smallint dispid 5;
property ActiveConnection: Smallint dispid 6;
property AgentStatistics: IDispatch dispid 7;
property CSTAEventCause: Smallint dispid 8;
property NumberOfWithdrawCauses: Smallint dispid 9;
property NumberOfAffectedTeam: Smallint dispid 10;
function AgentLogon(const Agent: WideString; const Team: WideString; const Password: WideString): WordBool; dispid 100;
function AgentLogoff(const Agent: WideString; const Team: WideString; const Password: WideString): WordBool; dispid 101;
function AlternateCall: WordBool; dispid 102;
function AnswerCall: WordBool; dispid 103;
function ClearConnection: WordBool; dispid 104;
function ConferenceCall: WordBool; dispid 105;
function HoldCall: WordBool; dispid 106;
function MakeCall(const Called: WideString): WordBool; dispid 107;
function ReconnectCall: WordBool; dispid 108;
function RetrieveCall: WordBool; dispid 109;
function TransferCall: WordBool; dispid 110;
function Ready(Cause: Smallint): WordBool; dispid 111;
function NotReady(Cause: Smallint): WordBool; dispid 112;
function WorkReady: WordBool; dispid 113;
function WorkNotReady: WordBool; dispid 114;
function ConsultationCall(const Called: WideString; const CorrelatorData: WideString): WordBool; dispid 115;
function AssociateData(const CorrelatorData: WideString): WordBool; dispid 116;
function NiceStartRecord(const Comment: WideString): WordBool; dispid 117;
function NiceStopRecord(const Comment: WideString): WordBool; dispid 118;
property LocalCallState[nConnection: Smallint]: Smallint dispid 200;
property CallingDevice[nConnection: Smallint]: WideString dispid 201;
property CalledDevice[nConnection: Smallint]: WideString dispid 202;
property AlertingDevice[nConnection: Smallint]: WideString dispid 203;
property AnsweringDevice[nConnection: Smallint]: WideString dispid 204;
property LastRedirectionDevice[nConnection: Smallint]: WideString dispid 205;
property ReleasingDevice[nConnection: Smallint]: WideString dispid 206;
property DivertingDevice[nConnection: Smallint]: WideString dispid 207;
property FailingDevice[nConnection: Smallint]: WideString dispid 208;
property HoldingDevice[nConnection: Smallint]: WideString dispid 209;
property QueuedDevice[nConnection: Smallint]: WideString dispid 210;
property RetrievingDevice[nConnection: Smallint]: WideString dispid 211;
property TransferringDevice[nConnection: Smallint]: WideString dispid 212;
property TransferredDevice[nConnection: Smallint]: WideString dispid 213;
property ConferenceControllerDevice[nConnection: Smallint]: WideString dispid 214;
property AddedPartyDevice[nConnection: Smallint]: WideString dispid 215;
property NewDestinationDevice[nConnection: Smallint]: WideString dispid 216;
property TrunkUsedDevice[nConnection: Smallint]: WideString dispid 217;
property CorrelatorData[nConnection: Smallint]: WideString dispid 218;
property WithdrawCauseText[nHold: Smallint]: WideString dispid 219;
property AffectedTeamName[Team: Smallint]: WideString dispid 220;
property TeamNameByQMCDU[const lpszQMCDU: WideString]: WideString dispid 221;
property EstimatedWaitingTime[nConnection: Smallint]: Integer dispid 222;
property PilotStatus[nConnection: Smallint]: Smallint dispid 223;
property PossibleTransfert[nConnection: Smallint]: WordBool dispid 224;
property WaitingQueueSaturation[nConnection: Smallint]: WordBool dispid 225;
end;

// *********************************************************************//
// DispIntf: IAgentPhoneEvents
// Flags: (4096) Dispatchable
// GUID: {B99E6418-8F09-11D1-9072-006008719609}
// *********************************************************************//
IAgentPhoneEvents = dispinterface
['{B99E6418-8F09-11D1-9072-006008719609}']
procedure OnConferenced; dispid 1;
procedure OnConnectionCleared; dispid 2;
procedure OnDeliveredOut; dispid 3;
procedure OnDeliveredIn; dispid 4;
procedure OnDiverted; dispid 5;
procedure OnEstablished; dispid 6;
procedure OnFailed; dispid 7;
procedure OnHeld; dispid 8;
procedure OnNetworkReached; dispid 9;
procedure OnOriginated; dispid 10;
procedure OnQueued; dispid 11;
procedure OnRetrieved; dispid 12;
procedure OnServiceInitiated; dispid 13;
procedure OnTransferred; dispid 14;
procedure OnLogon; dispid 15;
procedure OnLogoff; dispid 16;
procedure OnNotReady; dispid 17;
procedure OnReady; dispid 18;
procedure OnWorkNotReady; dispid 19;
procedure OnWorkReady; dispid 20;
procedure OnBackInService; dispid 21;
procedure OnOutOfService; dispid 22;
procedure OnMonitorStartAgent; dispid 23;
procedure OnMonitorStopAgent; dispid 24;
procedure OnMonitorEndedAgent; dispid 25;
procedure OnCSTAFailure(Fail: Integer); dispid 26;
procedure OnACSFailure(Fail: Integer); dispid 27;
end;

// *********************************************************************//
// DispIntf: IAgentStatistics
// Flags: (4096) Dispatchable
// GUID: {A4BE6396-925B-11D1-9072-006008719609}
// *********************************************************************//
IAgentStatistics = dispinterface
['{A4BE6396-925B-11D1-9072-006008719609}']
property AgentName: WideString dispid 1;
property AgentServiceState: Smallint dispid 2;
property AgentServiceStateTime: Integer dispid 3;
property AgentLastLoginTime: Integer dispid 4;
property AgentPhoneState: Smallint dispid 5;
property AgentPhoneStateTime: Integer dispid 6;
property AgentNumberOfWithdraws: Smallint dispid 7;
property AgentWithdrawTime: Integer dispid 8;
property AgentNumberOfConversationsACD: Smallint dispid 9;
property AgentConversationPrivTime: Integer dispid 10;
property AgentNumberOfAbandons: Smallint dispid 11;
property AgentNumberOfIntercepts: Smallint dispid 12;
property AgentNumberOfTransfers: Smallint dispid 13;
property AgentPilotName: WideString dispid 14;
property AgentNumberOfConversationsPriv: Smallint dispid 15;
end;

// *********************************************************************//
// DispIntf: IAgentStatisticsEvents
// Flags: (4096) Dispatchable
// GUID: {A4BE639A-925B-11D1-9072-006008719609}
// *********************************************************************//
IAgentStatisticsEvents = dispinterface
['{A4BE639A-925B-11D1-9072-006008719609}']
procedure OnStatistics(Status: Integer); dispid 1;
end;

CoCCAOleServ = class
class function Create: ICCAOleServ;
class function CreateRemote(const MachineName: string): ICCAOleServ;
end;

CoAgentPhone = class
class function Create: IAgentPhone;
class function CreateRemote(const MachineName: string): IAgentPhone;
end;

CoAgentStatistics = class
class function Create: IAgentStatistics;
class function CreateRemote(const MachineName: string): IAgentStatistics;
end;

implementation

uses ComObj;

class function CoCCAOleServ.Create: ICCAOleServ;
begin
Result := CreateComObject(CLASS_CCAOleServ) as ICCAOleServ;
end;

class function CoCCAOleServ.CreateRemote(const MachineName: string): ICCAOleServ;
begin
Result := CreateRemoteComObject(MachineName, CLASS_CCAOleServ) as ICCAOleServ;
end;

class function CoAgentPhone.Create: IAgentPhone;
begin
Result := CreateComObject(CLASS_AgentPhone) as IAgentPhone;
end;

class function CoAgentPhone.CreateRemote(const MachineName: string): IAgentPhone;
begin
Result := CreateRemoteComObject(MachineName, CLASS_AgentPhone) as IAgentPhone;
end;

class function CoAgentStatistics.Create: IAgentStatistics;
begin
Result := CreateComObject(CLASS_AgentStatistics) as IAgentStatistics;
end;

class function CoAgentStatistics.CreateRemote(const MachineName: string): IAgentStatistics;
begin
Result := CreateRemoteComObject(MachineName, CLASS_AgentStatistics) as IAgentStatistics;
end;

end.
 
事件也是可以用delphi,不过比较麻烦,delphi带了个例子
/Borland/Delphi5/Demos/Activex/Oleauto/Word8/word8auto.dpr
这是一个如何连接word的事件的例子
 
就我这种情况行吗?
能给我一点例子吗?
谢谢!
 
>>hubdog
天那,我的是delphi4 没发现
 
事件当然都是一样的处理方法了

要不我mail给你吧,不过代码不是太容易懂,你得好好研究研究才行


 
>>hubdog
给我mail吧谢谢!!
email:liangguowei@yeah.net
 
还有能否对这个cca.tlb
说说如何实现吗?
如: procedure OnMonitorStartAgent; dispid 23;
别的如:property AgentStatistics: IDispatch dispid 7;
都是可实现的。
就是如何去捕获On******类型的procedure
 
当然可以实现,你看了代码就清楚了,我已经发出去了
 
>>hubdog:
您好。
谢谢,我已经收到你的email 了。
 
to hubdog:
实在对不起,那天未能看明白你寄来的代码。接下来出差到现在才回来。
完了还得抽时间看明白它。太谢谢你了
 
后退
顶部