|
-
February 5th, 2002, 05:54 AM
#1
Preventing end of a SDI application
Hi there,
The application I'm working on is SDI application style.
The InitInstance function, creates an object from my own class which will manage independant threads. After the creation of the object, the main application stops its execution, so the threads are killed !
Here is the code :
BOOL MyApp::InitInstance()
{
MyClass object;
object.Go();
return TRUE;
}
My question : how can I keep alive an application that creates an object that will manage threads ? The important fact is that the application can't enter in an eternal loop because the object created must interact with the application to give it details on its work.
Thanks. Hope my explanations were clear to understand.
-
February 5th, 2002, 06:15 AM
#2
Re: Preventing end of a SDI application
Hi,
Put the line
MyClass object;
in your header file. It gets destroyed because it goes out of scope. All Luck.
http://www.geocities.com/contactgirish/homepage.html>> VC++ Links,Code,Tutorials,Downloads & Notes.
If you have some time, you can sign the guestbook there. Thank you.
-
February 5th, 2002, 06:22 AM
#3
Re: Preventing end of a SDI application
You define the object that initiates your threads inside the view class. The problem is ( I think ) that you define the class inside a function and when it terminates, the treads are terminated too.
Dimitris Xernos
Telecommunications Engineer
Lannet SA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|