I have a simple function, which writes to a .txt file. This method works perfectly in a simple C++ project. But the same function, when created in a C++ SmartDeviceProject, does not write anything to the file.
What is the problem?
The code sample is given below.
STDMETHODIMP CHelloproxy::Hai(void)
{
CTime t = CTime::GetCurrentTime();
fstream file("D:\\k.txt", ios::app);
file << t.GetHour() << ":" << t.GetMinute() << ":" << t.GetSecond() << "-"
<< "Add() operation started..." << endl;
//file<<t.Format() << "-" << "Add() operation started..." << endl;
HRESULT hr = proxy->Hai();
file <<t.GetHour() << ":" << t.GetMinute() << ":" << t.GetSecond()
<< "-" << "Add() operation finished..." << endl;
file.close();
return hr;
}