Click here to Skip to main content
15,896,269 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionn-ary tree traversing Pin
DattaMane27-Jul-09 0:56
DattaMane27-Jul-09 0:56 
AnswerRe: n-ary tree traversing Pin
CPallini27-Jul-09 1:31
mveCPallini27-Jul-09 1:31 
AnswerRe: n-ary tree traversing Pin
David Crow27-Jul-09 3:25
David Crow27-Jul-09 3:25 
QuestionHow to reload the content in ifstream? Pin
DevelopmentNoob27-Jul-09 0:09
DevelopmentNoob27-Jul-09 0:09 
AnswerRe: How to reload the content in ifstream? Pin
CPallini27-Jul-09 0:17
mveCPallini27-Jul-09 0:17 
GeneralRe: How to reload the content in ifstream? Pin
DevelopmentNoob27-Jul-09 15:08
DevelopmentNoob27-Jul-09 15:08 
GeneralRe: How to reload the content in ifstream? Pin
CPallini27-Jul-09 20:53
mveCPallini27-Jul-09 20:53 
QuestionCStdioFile Creation fails with exception - no error occurred Pin
Deepak.Prahlad26-Jul-09 23:55
Deepak.Prahlad26-Jul-09 23:55 
Hi All,

I am trying to create a CStdioFile using below code. I plan to create the file where the ".exe" is. If the folder happens to be 'read only' the file creation fails as expected but the exception shows "no error occurred" Sniff | :^)


ie. bRet is FALSE (as expected) when tried to open the file. but the szError is "no error occured" (I guess here it should be "no write permission" or something like that)

Am I doing something wrong in the code? Please help.

BOOL CLoggerDlg::OpenFile(CString szFileName)
{
	CFileException ex;
	BOOL bRet = FALSE;
	if(LogFile.m_hFile == INVALID_HANDLE_VALUE)
	{
		bRet = LogFile.Open(szFileName,CStdioFile::modeCreate | CStdioFile::modeReadWrite | CStdioFile::shareDenyWrite | CStdioFile::modeNoTruncate,NULL);
		if ( !bRet )
		{
			TCHAR szError[1024];
			ex.GetErrorMessage(szError, 1024);
			MessageBox(szError);
		}
	}
	return bRet;
}

AnswerRe: CStdioFile Creation fails with exception - no error occurred Pin
CPallini27-Jul-09 0:02
mveCPallini27-Jul-09 0:02 
GeneralRe: CStdioFile Creation fails with exception - no error occurred Pin
Deepak.Prahlad27-Jul-09 0:11
Deepak.Prahlad27-Jul-09 0:11 
AnswerRe: CStdioFile Creation fails with exception - no error occurred Pin
Adam Roderick J27-Jul-09 0:12
Adam Roderick J27-Jul-09 0:12 
Questiondisplaying HEX value of any integer. Pin
MahaKh26-Jul-09 23:24
MahaKh26-Jul-09 23:24 
AnswerRe: displaying HEX value of any integer. [modified] Pin
Adam Roderick J26-Jul-09 23:32
Adam Roderick J26-Jul-09 23:32 
AnswerRe: displaying HEX value of any integer. Pin
CPallini26-Jul-09 23:36
mveCPallini26-Jul-09 23:36 
GeneralRe: displaying HEX value of any integer. Pin
bilal haider27-Jul-09 0:42
bilal haider27-Jul-09 0:42 
GeneralRe: displaying HEX value of any integer. Pin
CPallini27-Jul-09 0:54
mveCPallini27-Jul-09 0:54 
Questionbluetooth code Pin
pramoddohre26-Jul-09 23:05
pramoddohre26-Jul-09 23:05 
QuestionRe: bluetooth code Pin
CPallini26-Jul-09 23:17
mveCPallini26-Jul-09 23:17 
AnswerRe: bluetooth code Pin
killabyte26-Jul-09 23:26
killabyte26-Jul-09 23:26 
QuestionHeaderCtrl Pin
kumar sanghvi26-Jul-09 22:51
kumar sanghvi26-Jul-09 22:51 
AnswerRe: HeaderCtrl [modified] Pin
Adam Roderick J26-Jul-09 22:54
Adam Roderick J26-Jul-09 22:54 
AnswerRe: HeaderCtrl Pin
«_Superman_»26-Jul-09 22:56
professional«_Superman_»26-Jul-09 22:56 
GeneralRe: HeaderCtrl [modified] Pin
kumar sanghvi26-Jul-09 23:23
kumar sanghvi26-Jul-09 23:23 
GeneralRe: HeaderCtrl Pin
kumar sanghvi27-Jul-09 0:20
kumar sanghvi27-Jul-09 0:20 
GeneralRe: HeaderCtrl Pin
«_Superman_»27-Jul-09 2:02
professional«_Superman_»27-Jul-09 2:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.