Threads...
-
Hi, I'm trying to use a thread in my app. I have read about in this web. I see that a thread must be associated to a dialog to show its variables. Now I use "AfxBeginThread" in the InitDialog and works for one dialog. But I have several dialogs, and I want to show a thread's variable in the active dialog,not only in one of this. I need to resume or supend the thread from the active dialog, too. I'm trying but I can't do it. Anyone knows which is the best way to do it, or any sample where I can see about it? I have tried to do a extern pointer to the thread but I have a link error... Thak you in advance. Regards, Javier
-
Hi, I'm trying to use a thread in my app. I have read about in this web. I see that a thread must be associated to a dialog to show its variables. Now I use "AfxBeginThread" in the InitDialog and works for one dialog. But I have several dialogs, and I want to show a thread's variable in the active dialog,not only in one of this. I need to resume or supend the thread from the active dialog, too. I'm trying but I can't do it. Anyone knows which is the best way to do it, or any sample where I can see about it? I have tried to do a extern pointer to the thread but I have a link error... Thak you in advance. Regards, Javier
Well if you don^t want to use global vars, you could put your thread-object into your main class (the one derived from CWinApp). The object is then reachable by all dialogs through AfxGetApp() (cast this to the correct type). Also you could use a singleton class with the Thread object as variable... This might be the best solution.. Greets, Davy
-
Well if you don^t want to use global vars, you could put your thread-object into your main class (the one derived from CWinApp). The object is then reachable by all dialogs through AfxGetApp() (cast this to the correct type). Also you could use a singleton class with the Thread object as variable... This might be the best solution.. Greets, Davy