Hola amigos. Bueno aca tengo un problemita al Atachar un evento en tiempo de ejecucion, Error esta en rojo y la linea que lo da es la que esta debajo.
El resto de la unidad funciona bien..
saludos
Código Delphi
[-]
unit TTSkype;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, SKYPE4COMLib_TLB, OleServer,shellApi;
Function IniTialize(Import:Boolean=True):Boolean;
Function GetUserContacts:IUserCollection;
Procedure MakeCall(Const S:String);
Procedure SendMessageSkype(Const S:String);
Procedure ImportContacts;
Procedure StartChat(Const s:String);
procedure SkypeError(Sender: TObject; const pCommand: ICommand;
Number: Integer; const Description: WideString);
var
Skype:TSkype;
implementation
Uses TTPerson,dball,TTid,TtItem,TtRoot,TtDbTtw,TtVar,TTTypes,SqlModule,AdoDB,
TTClass,Ttver,UdmLang;
Function IniTialize(Import:Boolean=True):Boolean;
Begin
Try
Result:=True;
If Skype=nil then
Skype :=Tskype.Create(nil);
Skype.OnError:=SkypeError;
if not Skype.Client.IsRunning then begin
ShowMessage(dmLang.MultiLangs.GetText('@Skype5'));
RaiseLastWin32Error;
end;
Skype.Attach(7,true);
If Import then
if MessageDlg(dmLang.MultiLangs.GetText('@Skype1')+','+ #13#10+
dmLang.MultiLangs.GetText('@Skype2'),mtconfirmation,[mbYes,mbno],-1) =id_yes then
ImportContacts;
except
Result:=False;
Skype:=nil;
end;
end;