I am working a project in Visual Studio 2008, using C++ that is started using a custom wizard. The wizard was provided by the vender and their starter code works fine. It appears to be in .NET but I do not have sufficient knowledge to determine the exact style in terms of MFC, CLR, etc. I need to grab some data and write it to a file. I'll start with a text file, then add a binary file. Here are the relevant lines of the nonsense I have so far.
int number1 = 11;
int number2 = 22;
CString tempBuffer;
TCHAR pfileName = _T("C:\temp.txt");
CStiolFile f1;
f1.Open( pFileName, Cfile::modeCreate | <and someother options>);
tembBuffer = "\nnumber1:" + number1 + " number2" + number2;
f1.WriteWtring( tempBuffer );
f1.Close;
This code writes "number is" but does not get the value.
I tried:
tempBuffer.Format(" number1 is %d", number1 );
But then the compiler complained about the line several lines up:
TCHAR pfileName = _T("C:\temp.txt");
saying T is an unrecognized character escape sequence.
In summary, I just need to open a file and write a bunch of values to it.
It always seems that the easy and simple stuff is so hard to find. But maybe I'm barking up the wrong tree. Give me some direction and I will be glad to use a different concept that is more appropriate.
Thank you
int number1 = 11;
int number2 = 22;
CString tempBuffer;
TCHAR pfileName = _T("C:\temp.txt");
CStiolFile f1;
f1.Open( pFileName, Cfile::modeCreate | <and someother options>);
tembBuffer = "\nnumber1:" + number1 + " number2" + number2;
f1.WriteWtring( tempBuffer );
f1.Close;
This code writes "number is" but does not get the value.
I tried:
tempBuffer.Format(" number1 is %d", number1 );
But then the compiler complained about the line several lines up:
TCHAR pfileName = _T("C:\temp.txt");
saying T is an unrecognized character escape sequence.
In summary, I just need to open a file and write a bunch of values to it.
It always seems that the easy and simple stuff is so hard to find. But maybe I'm barking up the wrong tree. Give me some direction and I will be glad to use a different concept that is more appropriate.
Thank you