-
August 1st, 2013, 05:34 AM
#1
[RESOLVED] CFILE::GetStatus failed??Whats wrong?
Hey guys ,
I am trying to open a file from local Path by the follwing code
CString csRegExtractFileRemote;
CFileException ef;
CFileStatus cfsStatus;
CFile cfSAP;
csRegExtractFileRemote = "c:\\SW\\RemoteFile\\sample.txt";
if ( cfSAP.GetStatus(csRegExtractFileRemote, cfsStatus))
{
cout<<"YES\n"<<endl;
// open up the Extract file and create an archive for it
cout<<" Opening Extract file "<<endl;
if( !cfSAP.Open( csRegExtractFileRemote, CFile::modeRead, &ef ) )
{
cout<<"FAILED\n"<<endl;
printf("File %S could not be opened - %S",csRegExtractFileRemote,ef.m_cause);
//cout<<"File '%s' could not be opened - %s", csRegExtractFileRemote, ef.m_cause);
return FALSE;
}
cout<<"SUCCESS\n"<<endl;
CArchive caSAP( &cfSAP, CArchive::load );
CString csNewLine,
csSyncStatus;
int iTotalLines = 0;
cout<<"Done till here"<<endl;
}
Compilation is success full ,but i am observing that some junk value i sthere in the path variable
After Reaching If statment cursor went to final return statment ...
I donknow whats wrong in this Code
Can any one help me to resolve this
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
|