how do i access the message loop from mfc?
i''m using some code (directshow) that sends its own unique events to the message loop, so those don''t show up in the classwizard thing. is there a way so i can directly access the loop?
i just started learning mfc so i don''t know these stuff. and yes, i''ve already ordered a book, i''m just waiting for it to come.
You can tell MFC to call a function when a particular message comes flinging through the pump:
In the .cpp file there''s a section something like this, in grey text:
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CSpectrumAnalyzerDlg)
ON_BN_CLICKED(IDC_BUTTON_ARM, OnButtonArm)
ON_BN_CLICKED(IDC_BUTTON_START, OnButtonStart)
ON_BN_CLICKED(IDC_BUTTON_STOP, OnButtonStop)
//Add this to it
ON_MESSAGE(WM_MessageICareAbout, MyMethodToHandleIt)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
And declare and define a method to handle the message
LRESULT CMyDlg::MyMethodToHandleIt(WPARAM wParam, LPARAM lParam)
Magmai Kai Holmlor
- Not For Rent
In the .cpp file there''s a section something like this, in grey text:
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CSpectrumAnalyzerDlg)
ON_BN_CLICKED(IDC_BUTTON_ARM, OnButtonArm)
ON_BN_CLICKED(IDC_BUTTON_START, OnButtonStart)
ON_BN_CLICKED(IDC_BUTTON_STOP, OnButtonStop)
//Add this to it
ON_MESSAGE(WM_MessageICareAbout, MyMethodToHandleIt)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
And declare and define a method to handle the message
LRESULT CMyDlg::MyMethodToHandleIt(WPARAM wParam, LPARAM lParam)
Magmai Kai Holmlor
- Not For Rent
Listen, this is very very important. MFC SUCKS!!! Goto: http://www.wxWindows.org, and it will change your life forever...trust me on this one.
"Journies Lead to Knowledge and Passion Lights the Way..."
~=NeuroMorphus=~
"Journies Lead to Knowledge and Passion Lights the Way..."
~=NeuroMorphus=~
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement