Click here to Skip to main content
15,888,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Assigning multi valued string. Pin
Luc Pattyn11-Aug-10 1:58
sitebuilderLuc Pattyn11-Aug-10 1:58 
QuestionCan't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
JongchanAhn10-Aug-10 18:01
JongchanAhn10-Aug-10 18:01 
AnswerRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
Cool_Dev10-Aug-10 18:20
Cool_Dev10-Aug-10 18:20 
GeneralRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
JongchanAhn10-Aug-10 18:50
JongchanAhn10-Aug-10 18:50 
GeneralRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
Cool_Dev10-Aug-10 18:59
Cool_Dev10-Aug-10 18:59 
AnswerRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
Aescleal10-Aug-10 19:38
Aescleal10-Aug-10 19:38 
GeneralRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
Cool_Dev10-Aug-10 19:57
Cool_Dev10-Aug-10 19:57 
GeneralRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? [modified] Pin
JongchanAhn10-Aug-10 21:43
JongchanAhn10-Aug-10 21:43 
Dear Cool_Dev

Thank you for your help

I've solved this problem.
Here are what I've done;

First of all,
It is not nessesary to move the ON_MESSAGE( USER_MESSAGE_2, &CMyWnd::OnMyMessage1HandlerApp ) entry to CMyWnd class's message map.

Even though CWinApp derived class is never meant to handle windows messages,
We still can hanlde windows messages in CWinApp derived class.
How?
This is how to get it done. It was simple.
Cast the Handler in App class's message map with CWnd::*

It should be like this;
ON_MESSAGE( USER_MESSAGE_2, (afx_msg LRESULT(AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM))OnMyMessage1HandlerApp )

Cast the Handler with (afx_msg LRESULT(AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM))
Then, problem solved.

But I haven't proved the safety of this casting during the application run-time.
Well, I compiled and run the application. It seems fine. Nothing odd happened so far with this type casting.

Thanks.

Chan from SEOUL

modified on Wednesday, August 11, 2010 3:50 AM

GeneralRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
Cool_Dev11-Aug-10 0:57
Cool_Dev11-Aug-10 0:57 
AnswerRe: Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why? Pin
dilara semerci10-Aug-10 20:32
dilara semerci10-Aug-10 20:32 
QuestionHot key conflict with input in Game Pin
wikywin10-Aug-10 17:10
wikywin10-Aug-10 17:10 
AnswerRe: Hot key conflict with input in Game Pin
Cool_Dev10-Aug-10 20:22
Cool_Dev10-Aug-10 20:22 
GeneralRe: Hot key conflict with input in Game Pin
wikywin10-Aug-10 21:51
wikywin10-Aug-10 21:51 
QuestionUnicode text in messagebox from utf-8 file - VC 6.0 Pin
Jayapal Chandran10-Aug-10 11:11
Jayapal Chandran10-Aug-10 11:11 
AnswerRe: Unicode text in messagebox from utf-8 file - VC 6.0 Pin
Aescleal10-Aug-10 11:46
Aescleal10-Aug-10 11:46 
GeneralRe: Unicode text in messagebox from utf-8 file - VC 6.0 Pin
Jayapal Chandran10-Aug-10 12:21
Jayapal Chandran10-Aug-10 12:21 
GeneralRe: Unicode text in messagebox from utf-8 file - VC 6.0 Pin
Aescleal10-Aug-10 19:36
Aescleal10-Aug-10 19:36 
GeneralRe: Unicode text in messagebox from utf-8 file - VC 6.0 Pin
Jayapal Chandran12-Aug-10 9:03
Jayapal Chandran12-Aug-10 9:03 
GeneralRe: Unicode text in messagebox from utf-8 file - VC 6.0 Pin
Jayapal Chandran7-Oct-10 0:53
Jayapal Chandran7-Oct-10 0:53 
QuestionWriteFile() API failed and GetLastError return 0x05 value. Pin
Member 390315410-Aug-10 4:54
Member 390315410-Aug-10 4:54 
AnswerRe: WriteFile() API failed and GetLastError return 0x05 value. Pin
Richard Andrew x6410-Aug-10 11:24
professionalRichard Andrew x6410-Aug-10 11:24 
AnswerRe: WriteFile() API failed and GetLastError return 0x05 value. Pin
Luc Pattyn10-Aug-10 11:46
sitebuilderLuc Pattyn10-Aug-10 11:46 
QuestionHELP: pair-value search & replace Pin
andwan010-Aug-10 4:24
andwan010-Aug-10 4:24 
AnswerRe: HELP: pair-value search & replace Pin
Moak10-Aug-10 12:55
Moak10-Aug-10 12:55 
AnswerRe: HELP: pair-value search & replace Pin
CPallini10-Aug-10 20:55
mveCPallini10-Aug-10 20:55 

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.