Click here to Skip to main content
15,848,905 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have this working in my 32 bit unicode build:
C++
// Open and delete the Log File
LogFile.open(m_LogFilePath, std::ofstream::out | std::ofstream::binary);

// Check for a file open failure
if (LogFile.fail() != 0)
{
	Prompt.LoadString(IDE_FILE_OPEN_ERR);
	AfxMessageBox((Prompt + "\n") + m_LogFilePath, MB_TOPMOST | MB_OK | MB_ICONINFORMATION);
}

// Write a header to the log file
Header.LoadString(IDS_LOG_FILE_HEADER);
Header += _T("\n\n");
LogFile << Header;


However the << operator fails in the 64 bit build.

Any idea why?
Posted

1 solution

 
Share this answer
 
Comments
Kyudos 23-Apr-15 17:48pm    
Thanks for the reply - but this doesn't seem to help. wofstream and ofstream give the same problem - suggesting it is not UNICODE that is the problem but x64...
Richard MacCutchan 24-Apr-15 3:10am    
Well unless you tell us what the problem is it is impossible to suggest anything more. Just saying "it fails" is not enough.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900