Solved

Recieving Text Input from a Dialog Box

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now