0

hello every one
i am making a program what requires that the user types in some text in a textbox.
the problem is, how do i get that text from the textbox into the std::string (or a other kind of string)?
i don't know how to do that in Win32, which i am using.

i had already tried to use the GetDlgItemText() function (and similar functions), but i don't know how to use that function, because i am not that good at C++. i don't know where and how to use that function.


i am using Microsoft Visual Studio 2010,
i am not using a windows form.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by kirenemook12
0

Hi, you have to use visual studio?

Because I'm using wxDev-C++, and in this plataform is easy to do what you want, since this is a "delphi" based plataform, making the user interface cool and easy handling.

If you can use wxDev-C++ I could help you.

Bye

0

I haven't done much of Win32 Programming. But am a bit familiar with it.
I assume that the text member-variable in the TextBox element stores the text.

System::Sting val=text_box->text;

Now val holds the value of the textbox, but not in the std::string but instead, System::String.

Now to convert this into the std::string, you could use something known as a Marshal,which can be a bit more complicated.

0

but what if i got more than one textbox?
or is text_box the handle to the textbox window?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.