Solved

Recieving Text Input from a Dialog Box

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Slow process to read Excel 15 104
Problem to adjust sheet 1 81
Is COM supported from Apache 1 37
Need more details 5 83
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

21 Experts available now in Live!

Get 1:1 Help Now