Click here to Skip to main content
15,888,461 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: std::map, fundamental get started problem RESOLVED Pin
bkelly139-Jun-13 4:46
bkelly139-Jun-13 4:46 
QuestionCFileException, discover reasons RESOLVED Pin
bkelly138-Jun-13 10:05
bkelly138-Jun-13 10:05 
AnswerRe: CFileException, discover reasons Pin
Richard MacCutchan8-Jun-13 21:40
mveRichard MacCutchan8-Jun-13 21:40 
GeneralRe: CFileException, discover reasons RESOLVED Pin
bkelly139-Jun-13 3:54
bkelly139-Jun-13 3:54 
GeneralRe: CFileException, discover reasons Pin
bkelly139-Jun-13 6:11
bkelly139-Jun-13 6:11 
GeneralRe: CFileException, discover reasons Pin
Richard MacCutchan9-Jun-13 9:23
mveRichard MacCutchan9-Jun-13 9:23 
GeneralRe: CFileException, discover reasons Pin
bkelly139-Jun-13 9:43
bkelly139-Jun-13 9:43 
GeneralRe: CFileException, discover reasons Pin
Richard MacCutchan9-Jun-13 20:41
mveRichard MacCutchan9-Jun-13 20:41 
If the open function does not throw an error then you need to check the return value and call GetLastError() to find out why, as described here[^]. Alternatively you can throw a new exception like:
C++
try
{
   if (!m_definition_file.Open(m_definition_file_name, CFile::modeRead))
   {
       DWORD error_number = GetLastError();
       throw new CFileException::OsErrorToException(error_number);
   }
}
catch( CFileException e )
{
    // handle the exception
}

Note that when calling GetLastError() you must call it immediately after the failing API function call, otherwise its return may not be valid.
Use the best guess

Answertried FormatMessage() Pin
bkelly139-Jun-13 7:07
bkelly139-Jun-13 7:07 
AnswerStill looking for reason text Pin
bkelly1322-Jun-13 12:17
bkelly1322-Jun-13 12:17 
GeneralRe: Still looking for reason text Pin
Richard MacCutchan23-Jun-13 0:51
mveRichard MacCutchan23-Jun-13 0:51 
GeneralRe: Still looking for reason text Pin
bkelly134-Jul-13 11:05
bkelly134-Jul-13 11:05 
GeneralRe: Still looking for reason text Pin
Richard MacCutchan4-Jul-13 20:50
mveRichard MacCutchan4-Jul-13 20:50 
QuestionHow to force C++ allocate memory from disk? Pin
Falconapollo7-Jun-13 23:49
Falconapollo7-Jun-13 23:49 
AnswerRe: How to force C++ allocate memory from disk? Pin
MicroVirus11-Jun-13 0:13
MicroVirus11-Jun-13 0:13 
GeneralRe: How to force C++ allocate memory from disk? Pin
Falconapollo11-Jun-13 0:19
Falconapollo11-Jun-13 0:19 
NewsProblem when apply cilk_for with ippiFFT of intel parallel Pin
tunheo5-Jun-13 23:37
tunheo5-Jun-13 23:37 
QuestionRemove COM Objects from VC++ projects Pin
Prashant Gupta 2413-Jun-13 20:05
Prashant Gupta 2413-Jun-13 20:05 
AnswerRe: Remove COM Objects from VC++ projects Pin
Richard MacCutchan3-Jun-13 21:01
mveRichard MacCutchan3-Jun-13 21:01 
GeneralRe: Remove COM Objects from VC++ projects Pin
Prashant Gupta 2413-Jun-13 22:39
Prashant Gupta 2413-Jun-13 22:39 
GeneralRe: Remove COM Objects from VC++ projects Pin
Richard MacCutchan3-Jun-13 22:51
mveRichard MacCutchan3-Jun-13 22:51 
GeneralRe: Remove COM Objects from VC++ projects Pin
Prashant Gupta 2413-Jun-13 23:30
Prashant Gupta 2413-Jun-13 23:30 
GeneralRe: Remove COM Objects from VC++ projects Pin
Richard MacCutchan3-Jun-13 23:43
mveRichard MacCutchan3-Jun-13 23:43 
AnswerRe: Remove COM Objects from VC++ projects Pin
Hrpreet singh6-Jun-13 0:36
Hrpreet singh6-Jun-13 0:36 
GeneralRe: Remove COM Objects from VC++ projects Pin
Prashant Gupta 2416-Jun-13 0:42
Prashant Gupta 2416-Jun-13 0:42 

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.