Solved

Recieving Text Input from a Dialog Box

Posted on 1997-06-13
2
279 Views
Last Modified: 2013-12-03
I am trying to recieve input from a dialog box in C++.  I am able to execute the box, and prompt the user for their name, and they are able to enter text with no problem.  However, I cannot retrieve this text and use it in any way.  I have tried using the procedure GetDlgItemText, with parameters HWindow, ID_NAMEEDIT (The ID control of the name), PlayersName (the string supposedly receiving the input), and MAXNAMELEN (the max length of a name).  I think the HWindow parameter is what is giving me the trouble.  This is supposed to be the handle of the Dialog Box, but this is also the handle of TMyWindow.  What handle should I use, or what else should I try?
Here is a copy of my resource file for the dialog box:
#define ID_NAMEEDIT 113

NAME DIALOG 74,57,176,63
STYLE DS_ABSALIGN | DS_SYSMODAL | DS_LOCALEDIT |      DS_MODALFRAME | DS_NOIDLEMSG | WS_POPUP | WS_VISIBLE |      WS_CAPTION
CAPTION "Welcome"
BEGIN
      CONTROL "&Name", 100, "static", SS_RIGHT | WS_CHILD |                WS_VISIBLE 7,11,29,12
      CONTROL "", ID_NAMEEDIT, "edit", ES_LEFT | WS_BORDER |                WS_TABSTOP | WS_CHILD 44,8,127,15
      CONTROL "&OK", IDOK, "button", BS_DEFPUSHBUTTON |                WS_TABSTOP | WS_CHILD 75,38,24,14
END

Thanks for your help.  If you need any more information about what I'm asking for, please e-mail me at MGarcia@Worldnet.att.net
                                         
0
Comment
Question by:mgarcia061397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:mgarcia061397
ID: 1398247
Adjusted points to 150
0
 
LVL 4

Accepted Solution

by:
AVaulin earned 150 total points
ID: 1398248
Be sure that you try read string before Dialog was closed, ie (as I understood you use BC compiler) read string before calling TDialog::OK method.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question