Solved

Recieving Text Input from a Dialog Box

Posted on 1997-06-13
2
283 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

623 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