Click here to Skip to main content
16,021,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to set the text of a Picture Control Pin
Amrit Agr15-Aug-11 23:22
Amrit Agr15-Aug-11 23:22 
GeneralRe: How to set the text of a Picture Control Pin
Richard MacCutchan16-Aug-11 0:16
mveRichard MacCutchan16-Aug-11 0:16 
GeneralRe: How to set the text of a Picture Control Pin
Code-o-mat16-Aug-11 2:02
Code-o-mat16-Aug-11 2:02 
AnswerRe: How to set the text of a Picture Control Pin
enhzflep16-Aug-11 3:33
enhzflep16-Aug-11 3:33 
QuestionDownload file from internet Pin
_Flaviu15-Aug-11 6:12
_Flaviu15-Aug-11 6:12 
AnswerRe: Download file from internet Pin
Chuck O'Toole15-Aug-11 7:03
Chuck O'Toole15-Aug-11 7:03 
GeneralRe: Download file from internet Pin
_Flaviu15-Aug-11 8:17
_Flaviu15-Aug-11 8:17 
QuestionCStdioFile::open will not throw an exception, going mad Pin
charlieg15-Aug-11 5:58
charlieg15-Aug-11 5:58 
it has to be something silly. Given the code snippet below, it is part of some code that determines if m_sLogFilename is valid. So, in my testing, I deliberately pass in a crazy name say "M:/no/way/my.log. This device and directory do not exist, so I expect traceFile.Open to throw an exception.

It does not. In fact, the code passes on to the write operation when it completely craters with an access violation.

Why is the .open succeeding?

C++
CStdioFile        traceFile;

try
{
   traceFile.Open(m_sLogFilename, CFile::modeCreate |
                  CFile::modeNoTruncate | CFile::modeWrite | CFile::shareDenyNone |
                  CFile::typeText);
}
catch (CFileException* pEx)
{
   int m_cause = pEx->m_cause;
   int m_IOsError = pEx->m_lOsError;
   FileExceptionToText(m_cause);

   pEx->Delete();

   return false;
}
try
{
   traceFile.Write("Dummy text", 10);
}
catch (CFileException* pEx)
{
   int m_cause = pEx->m_cause;
   int m_IOsError = pEx->m_lOsError;
   FileExceptionToText(m_cause);

   pEx->Delete();

   return false;
}

traceFile.Close();

Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.

"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759


AnswerRe: CStdioFile::open will not throw an exception, going mad Pin
Graham Breach15-Aug-11 6:24
Graham Breach15-Aug-11 6:24 
GeneralRe: CStdioFile::open will not throw an exception, going mad Pin
charlieg15-Aug-11 6:52
charlieg15-Aug-11 6:52 
QuestionEmbedded Sytems Pin
pix_programmer14-Aug-11 23:39
pix_programmer14-Aug-11 23:39 
AnswerRe: Embedded Sytems Pin
Richard MacCutchan15-Aug-11 3:37
mveRichard MacCutchan15-Aug-11 3:37 
AnswerRe: Embedded Sytems Pin
CPallini15-Aug-11 23:39
mveCPallini15-Aug-11 23:39 
GeneralRe: Embedded Sytems Pin
pix_programmer16-Aug-11 0:13
pix_programmer16-Aug-11 0:13 
GeneralRe: Embedded Sytems Pin
CPallini16-Aug-11 0:17
mveCPallini16-Aug-11 0:17 
GeneralRe: Embedded Sytems Pin
pix_programmer16-Aug-11 0:24
pix_programmer16-Aug-11 0:24 
GeneralRe: Embedded Sytems Pin
CPallini16-Aug-11 0:32
mveCPallini16-Aug-11 0:32 
QuestionMySQL and ODBC!? Pin
Hadi Dayvary13-Aug-11 8:31
professionalHadi Dayvary13-Aug-11 8:31 
AnswerRe: MySQL and ODBC!? Pin
jschell14-Aug-11 7:15
jschell14-Aug-11 7:15 
GeneralRe: MySQL and ODBC!? Pin
Hadi Dayvary14-Aug-11 7:19
professionalHadi Dayvary14-Aug-11 7:19 
GeneralRe: MySQL and ODBC!? Pin
jschell15-Aug-11 8:32
jschell15-Aug-11 8:32 
QuestionAbout Hook InternetConnectA and HttpOpenRequestA modify URLs Pin
678474613-Aug-11 8:11
678474613-Aug-11 8:11 
AnswerRe: About Hook InternetConnectA and HttpOpenRequestA modify URLs Pin
Richard MacCutchan13-Aug-11 22:40
mveRichard MacCutchan13-Aug-11 22:40 
GeneralRe: About Hook InternetConnectA and HttpOpenRequestA modify URLs Pin
678474613-Aug-11 23:01
678474613-Aug-11 23:01 
GeneralRe: About Hook InternetConnectA and HttpOpenRequestA modify URLs Pin
Richard MacCutchan13-Aug-11 23:19
mveRichard MacCutchan13-Aug-11 23:19 

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.