Skip to main content
GameDev.net gamedev.net
🔒 Locked

Reading Strings in MFC

Started by Curtis123 Feb 19, 2003 at 11:36 AM 2 replies 250+ views
Original Post
Curtis123
Curtis123
How can I prompt the user to enter the name of someone or Something, and then display in a larger text box information that corresponds with what they typed in. I know this sounds simple, but I''m not quite sure on the exact functions I should use to read the string.
Fantasio
Fantasio
Create a CEdit control, then call, CEdit::GetWindowText() or SetWindowText().
kuphryn
kuphryn
Text input will require an edit control object. MessageBox() and AfxMessageBox() are one set of solution for displaying texts.

Kuphryn
Basiror
Basiror
i think he wants a small popup dialog like the windows login dialog

create a dialog resource link it to a class
and then add you edit controls to this dialog
link these controls as member variables of the derived dialog
and then create the dialog like this


CDerivedDialog dDlg;
Dlg.DoModal();
that should work i think


from a standard SDI application generated by the classwizzard

easy isnt it quite frankly you can learn most of mfc within 3-4 weeks
void CEditorApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
http://www.8ung.at/basiror/theironcross.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.