Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with String Array[Solved] Pin
T.RATHA KRISHNAN11-Aug-10 1:54
T.RATHA KRISHNAN11-Aug-10 1:54 
GeneralRe: Problem with String Array[Solved] Pin
Nuri Ismail11-Aug-10 2:51
Nuri Ismail11-Aug-10 2:51 
QuestionUnRegisterHotKey problem Pin
wikywin10-Aug-10 22:21
wikywin10-Aug-10 22:21 
AnswerRe: UnRegisterHotKey problem Pin
Niklas L10-Aug-10 22:46
Niklas L10-Aug-10 22:46 
GeneralRe: UnRegisterHotKey problem Pin
wikywin10-Aug-10 22:57
wikywin10-Aug-10 22:57 
GeneralRe: UnRegisterHotKey problem Pin
Niklas L10-Aug-10 23:07
Niklas L10-Aug-10 23:07 
GeneralRe: UnRegisterHotKey problem Pin
wikywin11-Aug-10 17:32
wikywin11-Aug-10 17:32 
GeneralRe: UnRegisterHotKey problem Pin
Niklas L11-Aug-10 20:58
Niklas L11-Aug-10 20:58 
AnswerRe: UnRegisterHotKey problem Pin
Luc Pattyn11-Aug-10 1:55
sitebuilderLuc Pattyn11-Aug-10 1:55 
GeneralRe: UnRegisterHotKey problem Pin
wikywin11-Aug-10 15:34
wikywin11-Aug-10 15:34 
GeneralRe: UnRegisterHotKey problem Pin
Luc Pattyn11-Aug-10 15:47
sitebuilderLuc Pattyn11-Aug-10 15:47 
QuestionAssigning multi valued string. Pin
T.RATHA KRISHNAN10-Aug-10 21:09
T.RATHA KRISHNAN10-Aug-10 21:09 
AnswerRe: Assigning multi valued string. Pin
Niklas L10-Aug-10 22:31
Niklas L10-Aug-10 22:31 
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 

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.