Skip to Content
author's profile photo
Former Member

[Delphi2005]Event handling

Hi,

How to set the event handlers with the application object in Delphi2005?

There is no App.OnItemEvent in SAPbouiCOM_TLB.Application, so I don't know how to catch the events.

My bad example:

TForm1 = class(TForm)

App: SAPbouiCOM_TLB.Application;

...

procedure MyItemEvent(const FormUID: WideString; var pVal: IItemEvent; out BubbleEvent: WordBool);

...

end;

...

procedure TForm1.FormActivate(Sender: TObject);

begin

App.<b>OnItemEvent</b>:= MyItemEvent;

end;

...

procedure TForm1.MyItemEvent(const FormUID: WideString; var pVal: IItemEvent; out BubbleEvent: WordBool);

begin

//...

end;

Any idea?

Thanks in Advance

Gabor

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Feb 11, 2005 at 03:04 PM

    Hi,

    Try use SAPbouiCOM_TLB.TApplication

    I think that should be something like that:

    private

    ...

    SBO_App: SAPbouiCOM_TLB.TApplication;

    procedure ApplicationMenuEvent (ASender: TObject; var pVal: IMenuEvent;

    out BubbleEvent: WordBool);

    procedure ApplicationAppEvent(ASender: TObject; EventType: BoAppEventTypes);

    procedure ApplicationItemEvent(ASender: TObject; const FormUID: WideString;

    var pVal: IItemEvent;

    out BubbleEvent: WordBool);

    ....

    procedure TForm1.FormCreate(Sender: TObject);

    begin

    SBO_App.OnAppEvent := ApplicationAppEvent;

    SBO_App.OnItemEvent := ApplicationItemEvent;

    SBO_App.OnMenuEvent := ApplicationMenuEvent;

    end;

    procedure TForm1.ApplicationAppEvent(ASender: TObject;

    EventType: BoAppEventTypes);

    begin

    //-

    end;

    procedure TForm1.ApplicationItemEvent(ASender: TObject;

    const FormUID: WideString; var pVal: IItemEvent;

    out BubbleEvent: WordBool);

    begin

    //-

    end;

    procedure TForm1.ApplicationMenuEvent(ASender: TObject;

    var pVal: IMenuEvent; out BubbleEvent: WordBool);

    begin

    //-

    end;

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 11, 2005 at 03:06 PM

    -

    Message was edited by: Ribeiro Santos

    Add comment
    10|10000 characters needed characters exceeded