#### Archived

This topic is now archived and is closed to further replies.

# Little Problem

This topic is 5011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I know this is easy, but I can''t get it to work. I have a "Display" button, that, when clicked will open a second dialog window and show you what the user typed. If nothing was typed it would let you know that as well saying "You must enter text into the edit box." Right I left that part out, the text that is to be displayed by the "Display" button is typed in an edit box with a variable name of "m_sMessage." So the message is written in the edit box, then the "Display" button is clicked showing the user what was typed (in the edit box) and if nothing was typed it would let the user know. I tried to use an if/else statement but I didn''t do it right. If yuo could help me out it would be much appreciated. Thankyou in advance! Oh by the way I am using MS Visual C++ MFC AppWizard. veni vidi vici "Be excellent to Each other" Bill and Ted

##### Share on other sites
Try showing some code. Specifically, how did you write your if/else statement?

##### Share on other sites
Well I would be more than happy to show my code, but I erased it multiple times after trying different things. I was hoping though that it would not be needed, because I thought this would be easy for most programmers and they could say how to do it. But no I can''t show my code becuase it doesn''t exist anymore becuase I wanted to make sure that the rest of the progam still worked.

##### Share on other sites
fencingone, you shouldn''t just expect someone to write the code for you. Show us YOUR attempt at the code and we can show you what''s wrong.

That being said, you want to structure your if statement like this.

if ( m_sMessage == ""){    //Nothing was typed, do your code here.}else{    //Something was Typed, do your other code here.}

~~~~~~~~~~~
Chris Vogel
~~~~~~~~~~~

##### Share on other sites
Just to be sure, did you perform DDE when the Display button was clicked (usually in an OnDisplay handler)?

• ### Forum Statistics

• Total Topics
628642
• Total Posts
2983998

• 9
• 9
• 10
• 21
• 20