Click here to Skip to main content
15,913,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Scrollbars ?? Pin
Jesper Knudsen7-Jul-04 12:39
Jesper Knudsen7-Jul-04 12:39 
GeneralRe: Scrollbars ?? Pin
0v3rloader7-Jul-04 14:59
0v3rloader7-Jul-04 14:59 
GeneralOk. More Qs on CDynLinkLibrary and apparent leak. Pin
CherezZaboro7-Jul-04 8:18
CherezZaboro7-Jul-04 8:18 
GeneralCheck Boxes Pin
DanYELL7-Jul-04 8:15
DanYELL7-Jul-04 8:15 
GeneralRe: Check Boxes Pin
Ravi Bhavnani7-Jul-04 8:28
professionalRavi Bhavnani7-Jul-04 8:28 
Generalthread (?) question Pin
sandrineV7-Jul-04 7:53
sandrineV7-Jul-04 7:53 
GeneralRe: thread (?) question Pin
palbano7-Jul-04 9:30
palbano7-Jul-04 9:30 
GeneralRe: thread (?) question Pin
sandrineV8-Jul-04 2:55
sandrineV8-Jul-04 2:55 
Thanks for your help, I have done the example suggested above, but still a lot of questions arise :

In the initInstance() method of the CMyThreadClass, this is done :

m_pMainWnd=new CMyDialogClass;
m_pMainWnd->SetForegroundWindow();
m_pMainWnd->ShowWindow(SW_SHOW);

Which means that when it is launched, the thread creates a new instance of a Dialog and displays it.

What if I just want to create a user interface thread on a button that is already defined in the main dialog of my class ?

Basically I would just like a "stop" button to be aware of clicks by the user, even though a child class is looping.

I think that one solution would be to create a thread for each child class, but I don't find this very pretty because no child class must run a the same time (except for the class implementing the "stop" command)

Another solution would be to create the "stop" command class as a worker thread, but then I suppose that a click on the button that launches the "stop" won't be accessible either.

Finally, I thought of creating a user interface threat which would handle the stop button, but if I create my Stop Button in the InitInstance() method of my CThreadClass, the button won't appear in the Dialog Ressource, and how can I display it ?

Could anyone tell me if these solutions seem relevant or not, and if one is better than the other ? Any advice would help, I'm a bit lost here.

Sorry again if these questions are irrelevant, but threads are really difficult


QuestionMaximaze window ??? Pin
Larsson7-Jul-04 6:41
Larsson7-Jul-04 6:41 
AnswerRe: Maximaze window ??? Pin
jmkhael7-Jul-04 6:44
jmkhael7-Jul-04 6:44 
GeneralRe: Maximaze window ??? Pin
Larsson7-Jul-04 7:04
Larsson7-Jul-04 7:04 
GeneralRe: Maximaze window ??? Pin
jmkhael7-Jul-04 7:08
jmkhael7-Jul-04 7:08 
Generaluser mapping of shortcut keys Pin
John R. Shaw7-Jul-04 6:38
John R. Shaw7-Jul-04 6:38 
GeneralRe: user mapping of shortcut keys Pin
DavidR_r7-Jul-04 8:49
DavidR_r7-Jul-04 8:49 
GeneralRe: user mapping of shortcut keys Pin
John R. Shaw7-Jul-04 9:47
John R. Shaw7-Jul-04 9:47 
GeneralChging default printers Pin
Jim Barrett7-Jul-04 6:28
Jim Barrett7-Jul-04 6:28 
Generalsubclassing in win32 Pin
Manu817-Jul-04 6:14
Manu817-Jul-04 6:14 
GeneralRe: subclassing in win32 Pin
Antti Keskinen7-Jul-04 10:54
Antti Keskinen7-Jul-04 10:54 
GeneralHooK API Problem Pin
cyberkit7-Jul-04 5:19
cyberkit7-Jul-04 5:19 
GeneralHyper-threading and MSDev6 Pin
[d3m0n]7-Jul-04 4:55
[d3m0n]7-Jul-04 4:55 
GeneralInstalling fonts .ttf and Type 1 Pin
Anonymous7-Jul-04 4:15
Anonymous7-Jul-04 4:15 
GeneralInstalling fonts .ttf and Type 1 Pin
Anonymous7-Jul-04 4:13
Anonymous7-Jul-04 4:13 
GeneralRe: Installing fonts .ttf and Type 1 Pin
David Crow7-Jul-04 4:47
David Crow7-Jul-04 4:47 
GeneralRe: Installing fonts .ttf and Type 1 Pin
Anonymous7-Jul-04 6:11
Anonymous7-Jul-04 6:11 
GeneralAccessing a web Service from VC++ application Pin
Member 5343577-Jul-04 3:51
Member 5343577-Jul-04 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.