Catch Text written down in combo box

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Jorik
Posts: 44
Joined: Tue Dec 08, 2009 4:47 pm

Catch Text written down in combo box

Post by Jorik »

Hi,

i added a edit box in my programm, and searching for a possibillity to get always the actual text written down there when a button has been clicked.

My code so far:




Code: Select all


gui::IGUIEditBox *_pSubmitNameBox = _pGUIEnvironment->addEditBox(L"", core::rect<s32>(45,148,368,192),false,_pBackgroundRootObject,3);

const wchar_t *objectToSaveText = _pSubmitNameBox->getText();




if i click a button this will be executed::

Code: Select all


std::cout <<objectToSaveText  << std::endl;


The output i get is unfortunatly not the text written down, it is the position where the pointer is saved.

I tried also:

Code: Select all

std::cout <<*objectToSaveText  << std::endl;

But then i get the ascii number.


How can i get the Text?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Catch Text written down in combo box

Post by randomMesh »

Jorik wrote:

Code: Select all

std::cout
You are trying to output wide char. cout won't work.
Either use irrlichts logger or std::wcout.
"Whoops..."
Jorik
Posts: 44
Joined: Tue Dec 08, 2009 4:47 pm

Post by Jorik »

Thx
Post Reply