Link to home
Start Free TrialLog in
Avatar of simonsmi
simonsmi

asked on

ofstream in UNICODE

I am porting some code to UNICODE.

The compiler doesn't like:

CString xxx;
xxx.Fomat(_T("Log.txt"));
ofstream fileOutput(xxx);

with error:

'__thiscall ofstream::ofstream(const char *,int,int)' : cannot convert parameter 1 from 'class CString' to 'const char *'


The code is fine in non-UNICODE.

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of simonsmi
simonsmi

ASKER

I thought there was a push for people to use the standard C++ language? Are there many other parts of it non-UNICODE compatible?
>>Are there many other parts of it non-UNICODE compatible?

Well, there are several (though I can't name them, as I only keep in mind the compatible ones ;-)

But as UNICODE support for the 'mainstream' OSs is limited to NT nowadays, I tend to use the Win32 UNICODE APIs when I have to deal with that character set...