Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling components on another form

Status
Not open for further replies.

fergmj

Programmer
Feb 21, 2001
276
US
I have a program that has two forms. I have included the header files. The app compiles correctly and when I ShowModal Form2 all is good.

Form1 loads on start-up and in the Form1 OnCreate event handler, I want to set the properties of some components on Form2.

How do I do this?

Thanks

fergmj
 
I am already doing that:
Form3->Serial11->Baud = ini->ReadInteger("com 11", "Baud", 9600);

and I get an error at runtime

fergmj
 
did you remember to put #include "Unit2.h" at the top of the calling form?

Unit2 of course being replaced by the form's header file name.
 
Yes, I have included the header file for all of the additional forms.
 
Ahh.. so you already said that you did... :)

what is the error message that you're getting?
 
I get an access violation error when I start the app.
 
try not sticking it in the OnCreate event, instead put it in the __fastcall TForm1::TForm1(TComponent* Owner) property. Then see if you get an error Cyprus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top