Originally posted by: Flora
char * filename = "c:\\test.txt";
first question compiler tell me
so i change the code
char * filename = "c:\\test.txt";
but i have a exception
my code is .....
CFileException *pError = NULL;
CStdioFile fileLog;
CString s;
CString output;
fileLog.Open((unsigned short *)filename, CFile::modeRead | CFile::shareExclusive |
CFile::typeText);
while (fileLog.ReadString(s,false))
{
output += s;
}
rror C2664: 'unsigned short *__thiscall CStdioFile::ReadString(unsigned short *,unsigned int)' : cannot convert parameter 1 from 'class CString' to 'unsigned short *'
CFileException *pError = NULL;
CStdioFile fileLog;
unsigned short * s;
CString output;
fileLog.Open((unsigned short *)filename, CFile::modeRead | CFile::shareExclusive |
CFile::typeText);
while (fileLog.ReadString(s,false))
{
output += s;
}
how can i do
Originally posted by: kristian jerpetj�n
Added line
content += "\r\n"
in example 1.
This gave a nicer text editor mode ;)
Originally posted by: flaffy
CStudioFile ???
And CStudioFile doesnt exist - only CStdFile - and there ReadString isnt available?
ReplyOriginally posted by: dozoo
if(m_ibuf[m_nextout] == '\n' && (m_nextout < _MAX_BUFSIZE))
{
m_nextout++;
}
Originally posted by: Hans Wedemeyer
fopen and _wfopen are supported under WinCE 3.0 (I'll check 4.0) and are easier to use....
Reply
Originally posted by: Pat R
Was WriteString tested?
Is there an example? Does it just not work on the emulator?
ReplyOriginally posted by: Heng cao
I use CArchive to read text file in WinCE 3.0 (eVC++3.0)
e.g
CFile file( lpszFileName, CFile::modeRead );
CArchive ar( &file, CArchive::load );
char buf[2];
ar.Read( buf, 2 );//ignore first two bytes of unicode file signature
CString line;
while( ar.ReadString( line ) )
{
....
}
Originally posted by: Gregory J. Spiers
Your main text states "CFile::typeText is stripped from the open flags when the Open method is called to avoid the ASSERT in the base class. It is not necessary to include this flag when using the CStudioFile class."
Your three examples all use this as an open flag; Does this not cause an ASSERT after all?
ReplyOriginally posted by: Helmut
Maybe in a rush you made following mistake:
-In example 2 and 3 there is no "s". Better to take buf and for unicode's sake the TEXT macro.
Quote:
There is nothing better than a living community!
Originally posted by: Red
Thank You
I Use This Lib.....