Click here to Skip to main content
15,905,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Specifying outgoing UDP port? Pin
Rathore Amit27-Jul-09 4:42
Rathore Amit27-Jul-09 4:42 
QuestionHow to delete a directory Pin
V K 227-Jul-09 2:54
V K 227-Jul-09 2:54 
AnswerRe: How to delete a directory Pin
Rajesh R Subramanian27-Jul-09 3:04
professionalRajesh R Subramanian27-Jul-09 3:04 
GeneralRe: How to delete a directory Pin
V K 227-Jul-09 3:12
V K 227-Jul-09 3:12 
GeneralRe: How to delete a directory Pin
Rajesh R Subramanian27-Jul-09 3:15
professionalRajesh R Subramanian27-Jul-09 3:15 
QuestionItem width of HeaderCtrl.. Pin
kumar sanghvi27-Jul-09 1:42
kumar sanghvi27-Jul-09 1:42 
AnswerRe: Item width of HeaderCtrl.. Pin
«_Superman_»27-Jul-09 2:03
professional«_Superman_»27-Jul-09 2:03 
AnswerRe: Item width of HeaderCtrl.. Pin
Iain Clarke, Warrior Programmer27-Jul-09 3:42
Iain Clarke, Warrior Programmer27-Jul-09 3:42 
Question[Message Deleted] Pin
sarita_21627-Jul-09 1:16
sarita_21627-Jul-09 1:16 
QuestionRe: serial communication in dilog based application in vc++ Pin
Chandrasekharan P27-Jul-09 1:24
Chandrasekharan P27-Jul-09 1:24 
AnswerRe: serial communication in dilog based application in vc++ Pin
sarita_21627-Jul-09 1:31
sarita_21627-Jul-09 1:31 
GeneralRe: serial communication in dilog based application in vc++ Pin
King Julien27-Jul-09 3:39
King Julien27-Jul-09 3:39 
GeneralRe: serial communication in dilog based application in vc++ Pin
sarita_21627-Jul-09 18:36
sarita_21627-Jul-09 18:36 
AnswerRe: serial communication in dilog based application in vc++ Pin
Iain Clarke, Warrior Programmer27-Jul-09 1:31
Iain Clarke, Warrior Programmer27-Jul-09 1:31 
Questionhelp on using VC++ libraries Pin
hareshel27-Jul-09 1:03
hareshel27-Jul-09 1:03 
AnswerRe: help on using VC++ libraries Pin
Adam Roderick J27-Jul-09 1:46
Adam Roderick J27-Jul-09 1:46 
GeneralRe: help on using VC++ libraries Pin
hareshel27-Jul-09 18:21
hareshel27-Jul-09 18:21 
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;
}

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.