Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Notepad creation in dialog based MFC Application Pin
Russell'2-Nov-08 23:39
Russell'2-Nov-08 23:39 
GeneralRe: Notepad creation in dialog based MFC Application Pin
David Crow3-Nov-08 3:24
David Crow3-Nov-08 3:24 
GeneralRe: Notepad creation in dialog based MFC Application Pin
Mark Salsbery3-Nov-08 5:10
Mark Salsbery3-Nov-08 5:10 
QuestionON_CONTROL_REFLECT_EX and message to control and parent Pin
Russell'2-Nov-08 22:34
Russell'2-Nov-08 22:34 
AnswerRe: ON_CONTROL_REFLECT_EX and message to control and parent Pin
Nishad S2-Nov-08 23:03
Nishad S2-Nov-08 23:03 
GeneralRe: ON_CONTROL_REFLECT_EX and message to control and parent Pin
Russell'2-Nov-08 23:23
Russell'2-Nov-08 23:23 
GeneralRe: ON_CONTROL_REFLECT_EX and message to control and parent Pin
Nishad S2-Nov-08 23:29
Nishad S2-Nov-08 23:29 
AnswerRe: ON_CONTROL_REFLECT_EX and message to control and parent Pin
Russell'2-Nov-08 23:04
Russell'2-Nov-08 23:04 
The solution looks:

BOOL CMyCButton::OnBnDblClicked(){
	GetParent()->PostMessage(WM_COMMAND, MAKELONG(GetDlgCtrlID(), BN_CLICKED), (LPARAM) GetSafeHwnd());
	return TRUE;  // TRUE to 'kill' the message: I don't want that the parent dialog receive it
}



or the same of:
ON_CONTROL_REFLECT(BN_DOUBLECLICKED, CMyCButton::OnBnDblClicked)

and
BOOL CMyCButton::OnBnDblClicked(){
	GetParent()->PostMessage(WM_COMMAND, MAKELONG(GetDlgCtrlID(), BN_CLICKED), (LPARAM) GetSafeHwnd());
}


but I'm not sure that it is the right way to manage messages when using derived controls, I was aspecting to do everything inside the control class: that call to GetParent() looks strange to me.

any comments?


Russell

GeneralRe: ON_CONTROL_REFLECT_EX and message to control and parent Pin
Iain Clarke, Warrior Programmer2-Nov-08 23:37
Iain Clarke, Warrior Programmer2-Nov-08 23:37 
GeneralRe: ON_CONTROL_REFLECT_EX and message to control and parent Pin
Russell'2-Nov-08 23:44
Russell'2-Nov-08 23:44 
QuestionHow to create Ini file and enter/retrieve data from it VC++ MFC [modified] Pin
anna mathew2-Nov-08 22:16
anna mathew2-Nov-08 22:16 
AnswerRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
Cedric Moonen2-Nov-08 22:24
Cedric Moonen2-Nov-08 22:24 
GeneralRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
anna mathew2-Nov-08 22:29
anna mathew2-Nov-08 22:29 
GeneralRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
CPallini2-Nov-08 22:47
mveCPallini2-Nov-08 22:47 
AnswerRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
CPallini2-Nov-08 22:45
mveCPallini2-Nov-08 22:45 
GeneralRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
anna mathew3-Nov-08 17:18
anna mathew3-Nov-08 17:18 
GeneralRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
CPallini3-Nov-08 21:35
mveCPallini3-Nov-08 21:35 
GeneralRe: How to create Ini file and enter/retrieve data from it VC++ MFC Pin
anna mathew3-Nov-08 22:00
anna mathew3-Nov-08 22:00 
QuestionMFC ActiveX control event question [modified] Pin
followait2-Nov-08 22:13
followait2-Nov-08 22:13 
Questionip address setting and adhoc configuration Pin
LaHaHa2-Nov-08 19:38
LaHaHa2-Nov-08 19:38 
AnswerRe: ip address setting and adhoc configuration Pin
Iain Clarke, Warrior Programmer2-Nov-08 23:54
Iain Clarke, Warrior Programmer2-Nov-08 23:54 
GeneralRe: ip address setting and adhoc configuration Pin
LaHaHa3-Nov-08 11:31
LaHaHa3-Nov-08 11:31 
QuestionCan we change the font size for existing createfont handle without creating again Pin
naga.anu2-Nov-08 19:04
naga.anu2-Nov-08 19:04 
AnswerRe: Can we change the font size for existing createfont handle without creating again Pin
Russell'2-Nov-08 23:32
Russell'2-Nov-08 23:32 
QuestionSocket programming Pin
Chandrasekharan P2-Nov-08 19:01
Chandrasekharan P2-Nov-08 19:01 

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.