Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

thuned

how do i access the message loop from mfc?

This topic is 6195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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=~

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!