Borland C++ Builder 5.0
Project contains Form1 and Form2
Form1 contains a button
When the Form1 is created (on run) a thread is spawned using:
_beginthread(WorkTask, 4096, (void *) this);
When Form1's button is clicked the following code is called:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
stuff_to_do = true;
}
The WorkTask is as follows:
void WorkTask(void *obj)
{
while(true)
{
Sleep (1);
if(stuff_to_do)
{
Form2->Show();
stuff_to_do = false;
}
}
}
So, basically, what I want is that when Form1's button is clicked,
Form2 is displayed (I know this seems messy, but in the wider project,
this is a good way to go. We will have a main form, which will
receive data via serial and ethernet links, and control the displaing
of sub-forms, or windows, representing appropriate data and
functionality).
This all works fine as long as Form2 contains no edit boxes, buttons,
or any control with which you can interact. If an edit box, etc., is
on Form2, then the application simply freezes, with Form2 in focus.
Any ideas or help apreciated,
Nick.
Project contains Form1 and Form2
Form1 contains a button
When the Form1 is created (on run) a thread is spawned using:
_beginthread(WorkTask, 4096, (void *) this);
When Form1's button is clicked the following code is called:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
stuff_to_do = true;
}
The WorkTask is as follows:
void WorkTask(void *obj)
{
while(true)
{
Sleep (1);
if(stuff_to_do)
{
Form2->Show();
stuff_to_do = false;
}
}
}
So, basically, what I want is that when Form1's button is clicked,
Form2 is displayed (I know this seems messy, but in the wider project,
this is a good way to go. We will have a main form, which will
receive data via serial and ethernet links, and control the displaing
of sub-forms, or windows, representing appropriate data and
functionality).
This all works fine as long as Form2 contains no edit boxes, buttons,
or any control with which you can interact. If an edit box, etc., is
on Form2, then the application simply freezes, with Form2 in focus.
Any ideas or help apreciated,
Nick.