Advertisement

Dialog box help..

Started by July 03, 2002 06:33 PM
4 comments, last by Borderline Hobo 22 years, 5 months ago
I have a dialog box with an edit box in it. I just need to know how to extract the text from the box and put it in a variable. Any help would be greatly appreciated.
Assuming you are working with MSVC 6:

With MFC you assign a variable of type CString to it and call UpdateData(TRUE) to have the text of the Edit control copied to the CString.

Without MFC you call GetDlgItemText() and pass it a pointer to a char array along with the size of the array where the text will be copied to.

Advertisement
What language (C++/Delphi/Java/Visual Basic)? What API are you using? (win32, MFC, VCL [Delphi, Borland C++ Builder], Swing [Java])
I use C++ and Win32 API.

GetDlgItemText(hwnd, 1002, buf, 100);

buf seems to come out empty everytime.
Crossposting is bad.
---visit #directxdev on afternet <- not just for directx, despite the name
I posted in general programming first. Then I saw the beginners forum, so I figured this was a beginner question.

This topic is closed to new replies.

Advertisement