Board index » cppbuilder » Trouble w/ Event Handler for Dynamically Created Component

Trouble w/ Event Handler for Dynamically Created Component

I'm having trouble getting the event handler for a component I created
dynamically to work.  Here's the code:

void __fastcall TForm1::BrowseButtonClick(TObject *Sender)
{}

from another function:

TButton *btnPtr;

 btnPtr = new TButton(Form1);
 btnPtr->Parent = Form1;
 btnPtr->OnClick = BrowseButtonClick;
I get a compiler error saying that BrowseButtonClick is not a member of
TForm1.  How do I make it a member?

TIA
-Kat

 

Re:Trouble w/ Event Handler for Dynamically Created Component


Did you forget to write a prototype declaration for the function and
place it in the associated header file, in the User declaration
section?
-------
Timothy H. Buchman
========================================
City Center Theater, New York NY
mail address tbuchmanPLEASE(at sign)REMOVEcitycenter.org
Please treat this signature information as confidential.
========================================
Search .borland message archive on http://www.mers.com/searchsite.html

Quote
Kathryn Jennings <k...@spamsucks.cs.utexas.edu> wrote in message

news:3AAD273A.5ECB8936@spamsucks.cs.utexas.edu...

Quote
> I'm having trouble getting the event handler for a component I
created
> dynamically to work.  Here's the code:

> void __fastcall TForm1::BrowseButtonClick(TObject *Sender)
> {}
> I get a compiler error saying that BrowseButtonClick is not a member
of
> TForm1.  How do I make it a member?

Re:Trouble w/ Event Handler for Dynamically Created Component


Quote
"Timothy H. Buchman" wrote:
> Did you forget to write a prototype declaration for the function and
> place it in the associated header file, in the User declaration
> section?

Yes.  Thanks.

Other Threads