Click here to Skip to main content
15,914,225 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
You posted the solution for yourself.

You are handling the conversion from BN_DOUBLECLICKED to BN_CLICKED in the button control as you desire.

But the whole purpose was to change the message to the parent from BN_DOUBLECLICKED to BN_CLICKED.

So you need to send / post the message to the parent. Which the GetParent () helps you with. If it makes it clearer for you, try this:

BOOL CMyCButton::OnBnDblClicked()
{
    HWND hButton = GetSafeHwnd ();
    HWND hDialog = GetParent (hButton);
    ::PostMessage(hDialog, WM_COMMAND, MAKELONG(GetDlgCtrlID(), BN_CLICKED), (LPARAM)hButton);
}


Ends up being the same though. I'd use SendMessage rather than PostMessage, but that's a different question.

Iain.
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 
AnswerRe: Socket programming Pin
Cedric Moonen2-Nov-08 21:05
Cedric Moonen2-Nov-08 21:05 

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.