Click here to Skip to main content
15,887,289 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionComboBox speed issue with XP style Pin
user94130-Sep-09 4:49
user94130-Sep-09 4:49 
QuestionUsing CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
Neil Urquhart30-Sep-09 4:16
Neil Urquhart30-Sep-09 4:16 
AnswerRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
sashoalm30-Sep-09 4:29
sashoalm30-Sep-09 4:29 
GeneralRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
Neil Urquhart30-Sep-09 4:39
Neil Urquhart30-Sep-09 4:39 
GeneralRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
David Crow30-Sep-09 5:43
David Crow30-Sep-09 5:43 
GeneralRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
Neil Urquhart30-Sep-09 6:44
Neil Urquhart30-Sep-09 6:44 
AnswerRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
David Crow30-Sep-09 6:50
David Crow30-Sep-09 6:50 
GeneralRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
Neil Urquhart4-Oct-09 20:59
Neil Urquhart4-Oct-09 20:59 
It seems if you don't use UpdateData(TRUE) in your OnChangeEdit.....() function then the member variable added to the control is not updated.

Ie the user will perhaps change a value from 1 to 12 in the integer CEdit box and without UpdateData(TRUE) the m_edit1 caught in the OnChangeEdit...() function will be 1 and not 12.

Also it seems the OnChangeEdit...() function can be called prior to OnInitDialog() and if UpdateData() is called at this time then problems will result. I protect my code against this by using a flag to indicate that the OnInitDialog() function had finished.


BOOL CCEditTestDlg::OnInitDialog()<br />
{<br />
	CDialog::OnInitDialog();<br />
<br />
	// Add "About..." menu item to system menu.<br />
<br />
	// IDM_ABOUTBOX must be in the system command range.<br />
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);<br />
	ASSERT(IDM_ABOUTBOX < 0xF000);<br />
<br />
	CMenu* pSysMenu = GetSystemMenu(FALSE);<br />
	if (pSysMenu != NULL)<br />
	{<br />
		CString strAboutMenu;<br />
		strAboutMenu.LoadString(IDS_ABOUTBOX);<br />
		if (!strAboutMenu.IsEmpty())<br />
		{<br />
			pSysMenu->AppendMenu(MF_SEPARATOR);<br />
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);<br />
		}<br />
	}<br />
<br />
	// Set the icon for this dialog.  The framework does this automatically<br />
	//  when the application's main window is not a dialog<br />
	SetIcon(m_hIcon, TRUE);			// Set big icon<br />
	SetIcon(m_hIcon, FALSE);		// Set small icon<br />
	<br />
	// TODO: Add extra initialization here<br />
<br />
	...<br />
	...<br />
	...<br />
<br />
	bDlgInitDone = TRUE ;<br />
<br />
	<br />
	return TRUE;  // return TRUE  unless you set the focus to a control<br />
}<br />
void CCEditTestDlg::OnChangeEdit1() <br />
{<br />
	// TODO: If this is a RICHEDIT control, the control will not<br />
	// send this notification unless you override the CDialog::OnInitDialog()<br />
	// function and call CRichEditCtrl().SetEventMask()<br />
	// with the ENM_CHANGE flag ORed into the mask.<br />
	<br />
	// TODO: Add your control notification handler code here<br />
<br />
	if(bDlgInitDone) UpdateData(TRUE) ;<br />
<br />
	TRACE("value is %d\n", m_edit1) ;<br />
<br />
	<br />
}

GeneralRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
David Crow5-Oct-09 2:49
David Crow5-Oct-09 2:49 
AnswerRe: Using CEdit with ES_NUMBER giving "Please enter a positive integer." followed by exception. Pin
Neil Urquhart30-Sep-09 5:24
Neil Urquhart30-Sep-09 5:24 
QuestionBarcode generator library Pin
Marc Soleda30-Sep-09 3:23
Marc Soleda30-Sep-09 3:23 
AnswerRe: Barcode generator library Pin
includeh1030-Sep-09 5:14
includeh1030-Sep-09 5:14 
AnswerRe: Barcode generator library Pin
Alan Balkany5-Oct-09 4:34
Alan Balkany5-Oct-09 4:34 
QuestionPure virtual Function ?? Pin
Game-point30-Sep-09 3:21
Game-point30-Sep-09 3:21 
AnswerRe: Pure virtual Function ?? Pin
David Crow30-Sep-09 3:25
David Crow30-Sep-09 3:25 
AnswerRe: Pure virtual Function ?? Pin
CPallini30-Sep-09 7:14
mveCPallini30-Sep-09 7:14 
QuestionHow to know that the programmatically that the current user is logged on through local machine or through Remote session ? Pin
Kushagra Tiwari30-Sep-09 3:10
Kushagra Tiwari30-Sep-09 3:10 
AnswerRe: How to know that the programmatically that the current user is logged on through local machine or through Remote session ? Pin
David Crow30-Sep-09 3:30
David Crow30-Sep-09 3:30 
AnswerRe: How to know that the programmatically that the current user is logged on through local machine or through Remote session ? Pin
kilt30-Sep-09 4:30
kilt30-Sep-09 4:30 
AnswerRe: How to know that the programmatically that the current user is logged on through local machine or through Remote session ? Pin
Randor 30-Sep-09 19:49
professional Randor 30-Sep-09 19:49 
Questionhow convert char[] to LPWSTR for create file !? Pin
hadi kazemi30-Sep-09 2:34
hadi kazemi30-Sep-09 2:34 
AnswerRe: how convert char[] to LPWSTR for create file !? Pin
Hristo-Bojilov30-Sep-09 2:39
Hristo-Bojilov30-Sep-09 2:39 
AnswerRe: how convert char[] to LPWSTR for create file !? Pin
Richard MacCutchan30-Sep-09 2:44
mveRichard MacCutchan30-Sep-09 2:44 
GeneralRe: how convert char[] to LPWSTR for create file !? Pin
Joe Woodbury30-Sep-09 6:08
professionalJoe Woodbury30-Sep-09 6:08 
GeneralRe: how convert char[] to LPWSTR for create file !? Pin
Richard MacCutchan30-Sep-09 6:21
mveRichard MacCutchan30-Sep-09 6:21 

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.