Click here to Skip to main content
15,884,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Error while using A_StringFromGUID2 Pin
Iain Clarke, Warrior Programmer26-Jun-11 23:19
Iain Clarke, Warrior Programmer26-Jun-11 23:19 
QuestionSetting Focus to a Dialog on Clicking it. [modified] Pin
pix_programmer26-Jun-11 22:48
pix_programmer26-Jun-11 22:48 
AnswerRe: Setting Focus to a Dialog on Clicking it. Pin
Iain Clarke, Warrior Programmer26-Jun-11 23:11
Iain Clarke, Warrior Programmer26-Jun-11 23:11 
GeneralRe: Setting Focus to a Dialog on Clicking it. Pin
pix_programmer26-Jun-11 23:18
pix_programmer26-Jun-11 23:18 
GeneralRe: Setting Focus to a Dialog on Clicking it. Pin
Iain Clarke, Warrior Programmer26-Jun-11 23:29
Iain Clarke, Warrior Programmer26-Jun-11 23:29 
AnswerRe: Setting Focus to a Dialog on Clicking it. Pin
d358207727-Jun-11 0:53
d358207727-Jun-11 0:53 
GeneralRe: Setting Focus to a Dialog on Clicking it. Pin
pix_programmer27-Jun-11 2:05
pix_programmer27-Jun-11 2:05 
QuestionON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 5:28
professionalMohibur Rashid26-Jun-11 5:28 
Here is the scenario

I have developed a custom class as below:

InsertEdit.h
class CInsertEdit :
	public CWnd
{
DECLARE_DYNAMIC(CInsertEdit)
	... 

protected:
	...
	
	afx_msg void GetCustomerName();
	afx_msg void GetInitialBalance();
	afx_msg void GetPhoneNumber();
	afx_msg void GetDateOfBirth();
	afx_msg void GetCountry();
	...
};


InsertEdit.cpp
#include "InsertEdit.h"

#define INSERTWINDOWCLASS L"INSERTWINDOWCLASS"
...
BEGIN_MESSAGE_MAP( CInsertEdit, CWnd)
	ON_WM_CTLCOLOR()
	ON_WM_CREATE()
	ON_WM_PAINT()
	ON_COMMAND(TEXT_2,GetCustomerName)
	ON_COMMAND(TEXT_3,GetInitialBalance)
	ON_COMMAND(TEXT_4,GetPhoneNumber)
	ON_COMMAND(TEXT_5,GetDateOfBirth)
	ON_COMMAND(TEXT_6,GetCountry)
END_MESSAGE_MAP()
IMPLEMENT_DYNAMIC(CInsertEdit, CWnd)
...
afx_msg void CInsertEdit::GetCustomerName()
	{
		wchar_t cst[256];
		UserName.GetWindowTextW(cst,256);
		MessageBox(cst,L"Test",MB_OK);
	}
...


I am expecting that any type of command like "Click" or "key stroke" will call the GetCustomerName function called. but it is not.

CInsertEdit is a custom class with few edit class in it..

Am I missing anything?

Shall I have to add anything special on main Window class or anywhere else?
AnswerRe: ON_COMMAND not working on mfc Pin
Richard MacCutchan26-Jun-11 6:04
mveRichard MacCutchan26-Jun-11 6:04 
GeneralRe: ON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 12:32
professionalMohibur Rashid26-Jun-11 12:32 
GeneralRe: ON_COMMAND not working on mfc Pin
Richard MacCutchan26-Jun-11 21:23
mveRichard MacCutchan26-Jun-11 21:23 
GeneralRe: ON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 21:28
professionalMohibur Rashid26-Jun-11 21:28 
GeneralRe: ON_COMMAND not working on mfc Pin
Iain Clarke, Warrior Programmer26-Jun-11 22:01
Iain Clarke, Warrior Programmer26-Jun-11 22:01 
GeneralRe: ON_COMMAND not working on mfc Pin
Richard MacCutchan26-Jun-11 22:48
mveRichard MacCutchan26-Jun-11 22:48 
GeneralRe: ON_COMMAND not working on mfc Pin
Iain Clarke, Warrior Programmer26-Jun-11 23:00
Iain Clarke, Warrior Programmer26-Jun-11 23:00 
GeneralRe: ON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 22:49
professionalMohibur Rashid26-Jun-11 22:49 
GeneralRe: ON_COMMAND not working on mfc Pin
Iain Clarke, Warrior Programmer26-Jun-11 22:59
Iain Clarke, Warrior Programmer26-Jun-11 22:59 
GeneralRe: ON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 23:18
professionalMohibur Rashid26-Jun-11 23:18 
GeneralRe: ON_COMMAND not working on mfc Pin
Iain Clarke, Warrior Programmer26-Jun-11 23:35
Iain Clarke, Warrior Programmer26-Jun-11 23:35 
GeneralRe: ON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 23:50
professionalMohibur Rashid26-Jun-11 23:50 
GeneralRe: ON_COMMAND not working on mfc Pin
Iain Clarke, Warrior Programmer26-Jun-11 22:08
Iain Clarke, Warrior Programmer26-Jun-11 22:08 
AnswerRe: ON_COMMAND not working on mfc Pin
Mark Salsbery26-Jun-11 6:22
Mark Salsbery26-Jun-11 6:22 
GeneralRe: ON_COMMAND not working on mfc [modified] Pin
Mohibur Rashid26-Jun-11 12:23
professionalMohibur Rashid26-Jun-11 12:23 
GeneralRe: ON_COMMAND not working on mfc Pin
Mark Salsbery26-Jun-11 13:50
Mark Salsbery26-Jun-11 13:50 
GeneralRe: ON_COMMAND not working on mfc Pin
Mohibur Rashid26-Jun-11 19:11
professionalMohibur Rashid26-Jun-11 19:11 

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.