Click to See Complete Forum and Search --> : still problems


xargon
September 14th, 2003, 06:12 PM
Hi,

I tried using the wstring function..However, I am still getting problems. of course, I am probablz using it completely wrong. If someone can help me, I would be extremely grateful.

I did a small tesy and have something like this. BTW: I am not using MFC

wstring test = L"ABS";
MessageBox (0, (const char *) test.c_str(), "", MB_OK);

No matter what I do, it always prints only the first letter in the message box...i.e A. I do not know much about these UNICODE strings. Any guidance on how I can convert them to normal C strings would be really great.

Thanks,

Xargon

Kheun
September 14th, 2003, 09:29 PM
If you are using VC6, go to Project->Settings->"C/C++". On the category drop-down list, select "Preprocessor". Key in "_UNICODE" in the "Preprocessor definitions" edit box.

It should work when you rebuild.

Mick
September 15th, 2003, 10:11 AM
I answered your question here:

http://www.codeguru.com/forum/showthread.php?s=&threadid=263107

are you still having problems?

xargon
September 16th, 2003, 06:04 AM
Nope :) Works like a dream. I just got in today, so did not get a chance to thank you before and no internet at home :(

Thanks,

Xargon

Mick
September 16th, 2003, 06:34 AM
:D