Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

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

    -

    Message was edited by: Ribeiro Santos

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.