-
August 1st, 2013, 07:31 AM
#1
CArchive load gives null lines
Hello all,
I am trying to reuse some code from my Visual C++ 2005. I am using CArchive to ReadString the first line of a file into another string. However, I am seeing squares where there should be spaces when I view it in the debugger. Can anyone explain what’s going on here?
Here's the code:
Code:
if( cfSAP.GetStatus(csRegExtractFileRemote, cfsStatus))
{
if( !cfSAP.Open( csRegExtractFileRemote, CFile::modeRead, &ef ) )
{
cout<<"FAILED\n"<<endl;
ef.ReportError();
return FALSE;
}
cout<<"SUCCESS\n"<<endl;
CArchive caSAP( &cfSAP, CArchive::load );
CString csNewLine;
int iTotalLines = 0;
while(1)
{
iTotalLines++;
//
// Read next line from file.
//
BOOL bVal1 = FALSE;
bVal1 = caSAP.ReadString(csNewLine);
if ( bVal1 == FALSE ) break;
printf("CurrentLine : %S ",csNewLine);
I am able to see some junk characters like this
㌳㐵‵†††䡓䙁⁔††䅍乔䵕䕂ㅒ㈰㐳㘵㔴㔶ㅃ㌵䌭㌭㤴㜵‸†††剂䍁䕋⁔†䅍乔䵕䕂㉒"
in csRegExtractFileRemote and also in the bool variable bval1
I am not able to read the lines due ti this bug ,
can any one help me in this
NOTE:This is normal text file contains two lines of information like this
0234568374C186-M-233545 SHAFT MATNUMBER1
0234564565C153-C-349578 BRACKET MATNUMBER2
Last edited by nini18110; August 1st, 2013 at 07:33 AM.
Reason: providing more info
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|