Own Events in TadxAddin

Add-in Express™ Support Service
That's what is more important than anything else

Own Events in TadxAddin
How to implement own Events logic in TypeLibrary 
Patrik Tesar




Posts: 2
Joined: 2006-11-28
Hi all.

I want to implement own events in AddinExpress tlb.

I've changed


  TComyTest = class(TadxAddin, IConnectionPointContainer, IComyTest)
  private
    { Private-Deklarationen }
    FConnectionPoints: TConnectionPoints;
    FConnectionPoint: TConnectionPoint;
    FSinkList: TList;
    FEvents: IComyTestEvents;
  public
    procedure Initialize; override;
  protected
    { Protected-Deklarationen }
    property ConnectionPoints: TConnectionPoints read FConnectionPoints
      implements IConnectionPointContainer;
    procedure EventSinkChanged(const EventSink: IUnknown); override;
  end;

uses ComServ;

procedure TComyTest.EventSinkChanged(const EventSink: IUnknown);
begin
  FEvents := EventSink as IComyTestEvents;
  if FConnectionPoint <> nil then
     FSinkList := FConnectionPoint.SinkList;
end;

procedure TComyTest.Initialize;
begin
  inherited Initialize;
  FConnectionPoints := TConnectionPoints.Create(Self);
  if AutoFactory.EventTypeInfo <> nil then
    FConnectionPoint := FConnectionPoints.CreateConnectionPoint(
      AutoFactory.EventIID, ckSingle, EventConnect)
  else FConnectionPoint := nil;
end;



Problem is that EventTypeInfo is allways falls with nil...

Is here someone who can help?

Best regards
Patrik
Posted 28 Nov, 2006 10:30:54 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Patrik,

It seems you have forgotten to correct the type library of your add-in. You can download the example project here:
http://www.add-in-express.com/projects/adx_events_test_d7.zip


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.

Posted 28 Nov, 2006 11:40:07 Top
Patrik Tesar




Posts: 2
Joined: 2006-11-28
Thanx! It work's now!
Posted 29 Nov, 2006 05:31:38 Top