|
-
February 19th, 2004, 05:13 AM
#1
CFileException not working in ReleaseMinDependecy Mode
hi
i have wriitern a windows nt service program. in this im reading a configuration file if the file is not present i will be wriiting the error into windows nt event log.
this is the code
if(fFile.Open(szFilePath,CFile::modeCreate|CFile::modeNoTruncate |CFile::modeReadWrite|CFile::shareDenyWrite))
{
fFile.SeekToEnd();
return TRUE;
}
else
{
CString szError,szLog;
char strerr[500];
fileException.GetErrorMessage(strerr,100);
szError.Format("Couldnt open the file %s please check the path ",szFilePath);
szLog=szError;
szLog+=strerr;
//event log
CServiceModule::LogEvent(_T(szLog),TPRSERVICE_ERROR,EVENTLOG_ERROR_TYPE);
}
the problem is the strerr variable is populated with error in debug mode but not in releasemindependency mode.
the length of strerr is returned as 0 in release mode and 24 in debug mode. i would like to know cause of this problem and appropriate remedy.
thanx in advance
regards
Aswin.N.Paranji
-
February 19th, 2004, 07:17 AM
#2
I can't belive this code is working in debug mode. Add &fileException as third parameter to the Open call and see what's happening.
The Saviour of the World is a Penguin and Linus Torvalds is his Prophet.
-
February 19th, 2004, 11:17 AM
#3
CFileException not working in ReleaseMinDependecy Mode
sorry boss,
that was the old code. well i have actually included the &fileException. i didnt copy that. sorry for that. im still haveing the problem
regards
Aswin
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
|