Click here to Skip to main content
15,917,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPU usage meter in win98 Pin
alex.barylski18-Nov-03 5:45
alex.barylski18-Nov-03 5:45 
GeneralRe: CPU usage meter in win98 Pin
Max Rudensky19-Nov-03 0:12
sussMax Rudensky19-Nov-03 0:12 
QuestionHow to control many events? Pin
Azury18-Nov-03 5:28
Azury18-Nov-03 5:28 
AnswerRe: How to control many events? Pin
David Crow18-Nov-03 5:47
David Crow18-Nov-03 5:47 
GeneralActiveX with modeless Dialog Pin
AnTri18-Nov-03 5:12
AnTri18-Nov-03 5:12 
GeneralRe: ActiveX with modeless Dialog Pin
Peter Molnar18-Nov-03 13:45
Peter Molnar18-Nov-03 13:45 
GeneralRe: ActiveX with modeless Dialog Pin
AnTri18-Nov-03 23:05
AnTri18-Nov-03 23:05 
GeneralRe: ActiveX with modeless Dialog Pin
Peter Molnar19-Nov-03 4:26
Peter Molnar19-Nov-03 4:26 
Sorry, I must have misunderstood you.
Your problem can then be led to communicating between modeless dialog and its creator thread.
For this you will have to be able to call the creator thread's functions, which is only possible if you pass a pointer of your creator thread to the modeless dialog. Using this pointer you post messages from the modeless dialog which can be caught in the control class.
Try the following:

1.Add to your modeless dialog (in the header file):
#define WM_SEND_MY_MESSAGE (WM_USER + 1) 
//..
COleControl* m_pCreator;  //a member variable:  
void inline SetCreatorThreadPointer(COleControl* pCreator) {m_pCreator = pCreator;}; //member function


2.Add to your control class a message handler:
ON_MESSAGE(WM_SEND_MY_MESSAGE, OnModelessDialogSend)

and also implement the function with prototype OnModelessDialogSend(WPARAM wParam, LPARAM lParam); From here you will fire your events.

3.In your control class:
m_pDialog->SetCreatorThreadPointer(this); 
m_pDialog->Create(...);


4.In your modeless dialog, when your message occurs, post a message to your control class:
m_pCreator->PostMessage( WM_SEND_MY_MESSAGE, (WPARAM)"Hi!");



Peter Molnar
Generalemail + attachement Pin
doctorpi18-Nov-03 4:47
doctorpi18-Nov-03 4:47 
GeneralRe: email + attachement Pin
David Crow18-Nov-03 5:51
David Crow18-Nov-03 5:51 
GeneralRe: email + attachement Pin
Peter Molnar18-Nov-03 14:05
Peter Molnar18-Nov-03 14:05 
GeneralRe: deleting pointers and STL. Pin
berndg18-Nov-03 4:10
berndg18-Nov-03 4:10 
GeneralRe: deleting pointers and STL. Pin
TFrancis18-Nov-03 4:11
TFrancis18-Nov-03 4:11 
GeneralThanks! to both!!! Pin
ns18-Nov-03 4:20
ns18-Nov-03 4:20 
GeneralError in Release !!! Pin
SD318-Nov-03 3:15
SD318-Nov-03 3:15 
GeneralRe: Error in Release !!! Pin
valikac18-Nov-03 5:58
valikac18-Nov-03 5:58 
GeneralRe: Error in Release !!! Pin
Peter Molnar18-Nov-03 14:18
Peter Molnar18-Nov-03 14:18 
GeneralRe: Error in Release !!! Pin
SD319-Nov-03 23:47
SD319-Nov-03 23:47 
QuestionHow to notify one thread to terminate Pin
Jin Yao18-Nov-03 2:38
Jin Yao18-Nov-03 2:38 
AnswerRe: How to notify one thread to terminate Pin
Dudi Avramov18-Nov-03 2:43
Dudi Avramov18-Nov-03 2:43 
GeneralRe: How to notify one thread to terminate Pin
Jin Yao18-Nov-03 3:05
Jin Yao18-Nov-03 3:05 
GeneralH263 Codec and Direct Show Pin
LozEvans18-Nov-03 2:06
LozEvans18-Nov-03 2:06 
GeneralTSP algorithm Pin
Dhakad18-Nov-03 2:00
Dhakad18-Nov-03 2:00 
GeneralRe: TSP algorithm Pin
David Crow18-Nov-03 6:57
David Crow18-Nov-03 6:57 
QuestionHow do you fork() windows guys ? Pin
Max Rudensky18-Nov-03 1:43
sussMax Rudensky18-Nov-03 1:43 

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.