![]() |
|
#1
|
|||
|
|||
How to check a string value read from an edit boxHI
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:
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
|
|||
|
|||
|
CEdit* edit; // CEdit of the aforesaid editbox, initiate it with GetDlgItem func
edit->GetWindowText(strString); if(strString.IsEmpty()) { ... ... ... } Hope it helps |
Recent GIDBlog
Developing GUIs with wxPython (Part 2) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
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