You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Mercior
Posts: 100 Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:
Post
by Mercior » Sun Mar 21, 2004 10:16 am
I am trying to read the text of an edit box GUI element into a char * from the wchar * but having troubles.. Im trying to use this:
Code: Select all
char tmps[128];
sprintf(tmps, "%s", cNPCSpawner.spawncount->getText());
This just prints the first character of the edit box into the char *. Any ideas?
Spidla
Posts: 31 Joined: Tue Nov 25, 2003 3:46 pm
Location: Czech Republic
Contact:
Post
by Spidla » Sun Mar 21, 2004 1:33 pm
Try this :
Code: Select all
#define CHAR_SIZE 20
char *ResultChar = new char[CHAR_SIZE];
wcstombs(ResultChar,WideString,CHAR_SIZE);
It is working without problems
Mercior
Posts: 100 Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:
Post
by Mercior » Sun Mar 21, 2004 7:15 pm
Perfect! Thanks very much