简体   繁体   中英

help in c++ mfc dialog

i need help knowing how to post up a message in mfc project. but i need to do it in a class which is not the dialog class.

i need it to check some values in another class and i want to be able to write some message in a window or something just to check some values im hope my explanation was clear. thanks in advance for the help

To send/post a message you can use (A) the CWnd methods SendMessage() / PostMessage() or (B) the ::SendMessage() / ::PostMessage() functions.
This can be done from anywhere, ie you can also send messages from non-window classes. The only thing you need is the target CWnd object (case A) or the handle of its window (case B).

No, your question is not clear. Please try to explain better what you want to do.

This is how you post a message to a window (assuming you have a CWnd reference to your window):

m_MyWnd.PostMessage(WM_APP, 0x1234, 0x4567);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM