GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-May-2005, 15:27
E2STE E2STE is offline
New Member
 
Join Date: May 2005
Posts: 1
E2STE is on a distinguished road
Question

How to check a string value read from an edit box


HI

Just started using mfc and am having problems reading a value that should be passed from an edit box.

I have created a 2 dialog boxes, 1 contains an edit box and a button.

I would like to do a check to see if anything has been written in the box and if it hasnt then i would like the other dialog box to be displayed saying, 'no string entered'.

I have assigned a member variable to the edit box called m_customerError



I have tried everything from if(m_customerError == ""), to if(IDC_CustomerError == "hello" and tried writing hello in, but when i debug to see what value has been recoded it just says ( "" ) so i think its not reading what im entering into the edit box.

My code is below, what do i need to write to check if anything has been entered?

CPP / C++ / C Code:
#include "customerError.h"

void CNewGUIDlg::OnSearchButton() 
{
	
	if( write check in here)
	{
		customerError Dlg; // second dialog box

		Dlg.DoModal(); //display dialog box
	}
	
}

I woud be very appreciative for any help.

Cheers ste.
Last edited by LuciWiz : 04-May-2005 at 15:30. Reason: Please insert your C++ code between [c++] & [/c++] tags
  #2  
Old 06-May-2005, 01:19
aie0 aie0 is offline
Member
 
Join Date: Dec 2004
Posts: 246
aie0 is a jewel in the roughaie0 is a jewel in the rough
Arrow

CEdit* edit; // CEdit of the aforesaid editbox, initiate it with GetDlgItem func
edit->GetWindowText(strString);
if(strString.IsEmpty())
{
...
...
...
}

Hope it helps
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 2) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Read a .html file, check that file for links salemite C Programming Language 10 17-Jan-2008 07:56
Re: Conversion: Binary, Decimal, Hexadecimal WaltP C Programming Language 1 10-May-2006 06:49
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 03:38
sorting string w/strcmp doc_watson2007 C Programming Language 4 20-Nov-2004 09:17

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:15.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.