ansi mode

Frank Reich's Avatar
Go4Expert Member
Hi.

I am having a standard SDI application that must be modified to be ANSI mode. How or where should I this modification?

Thanks.
F.R.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
There is nothing called ANSI mode but there is something called ASCII mode and unicode mode. Do you mean the ASCII mode ??.
Frank Reich's Avatar
Go4Expert Member
Dear Shabbir,

thanks for the reply! well the problem i am facing is as follows (written in a SDI application):
Code:
char buf    [MAX_PATH+2];
GetModuleFileName(NULL,(LPWCH)buf,MAX_PATH);
std::stringstream folder;
folder << buf;
this code above won't work, as LPWCH is a pointer to a unicode sign, and buf is a 'normal' character. so i got the advice to change the project to be ANSI mode. but as it seems it should be ASCII, like you said it in your post. so how can i change it to be ASCII?

THANKS!
F.R.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Either go for everything in ASCII or unicode.

I would like to know what is the procedure you are building your application. Is it in unocde or normal ASCII. It looks like it is normal ASCII because you are using char and not WCHAR

What I meant is dont type cast to LPWCH but some its equivalent in ASCII and it should be some thing like LPCH but you should check out the MSDN or try using the WCHAR instead.

If you use WCHAR but then also compile in normal ASCII mode I would suggest you the T version. TCHAR which automatically maps to the correct version you are building your application.
Frank Reich's Avatar
Go4Expert Member
Yes, I assume I am using everything in ASCII, because I don't use anything like WCHAR or wstring or whatever.

i used 'wchar_t' instead but it didn't work either. what i just would like to do is to save the path of my program into a stringstream. i don't know why it seems so difficult
Frank Reich's Avatar
Go4Expert Member
i think this is the solultion:
http://www.thescripts.com/forum/thread458533.html