Click here to Skip to main content
14,697,718 members
Home » Discussions » ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: std::map and error checking Pin
Richard MacCutchan9-Jun-13 22:23
mveRichard MacCutchan9-Jun-13 22:23 
AnswerRe: std::map and error checking Pin
MicroVirus11-Jun-13 13:07
MemberMicroVirus11-Jun-13 13:07 
Questionstatus display in a dialog Pin
bkelly139-Jun-13 6:17
Memberbkelly139-Jun-13 6:17 
AnswerRe: status display in a dialog Pin
Garth J Lancaster9-Jun-13 15:53
professionalGarth J Lancaster9-Jun-13 15:53 
Questionstd::map, fundamental get started problem RESOLVED Pin
bkelly139-Jun-13 5:04
Memberbkelly139-Jun-13 5:04 
AnswerRe: std::map, fundamental get started problem Pin
xenotron9-Jun-13 5:19
Memberxenotron9-Jun-13 5:19 
GeneralRe: std::map, fundamental get started problem RESOLVED Pin
bkelly139-Jun-13 5:46
Memberbkelly139-Jun-13 5:46 
QuestionCFileException, discover reasons RESOLVED Pin
bkelly138-Jun-13 11:05
Memberbkelly138-Jun-13 11:05 
Windows 7, 64 bit, Visual Studio 2008, MFC, C++

After a long series of searches looking for a nice method of reading from a text file into CString I arrived at the following:
<br />
CStdioFile definition_file;<br />
try<br />
      {<br />
         definition_file.Open( m_definition_file_name, CFile::modeRead );<br />
      }<br />
      catch( CFileException e )<br />
      {<br />
         e.m_cause;<br />
      }<br />


This is from the VS help utility:
<br />
catch( CFileException* e )<br />
{<br />
   if( e->m_cause == CFileException::fileNotFound )<br />
      printf( "ERROR: File not found\n")<br />
   e->Delete();<br />
}<br />

This leads to the concept
<br />
if( e->m_cause == CFileException::fileNotFound )<br />
      printf( "ERROR: File not found\n");<br />
elseif( e->m_cause == CFileException::generic )<br />
      printf( "ERROR: An unspecified error occurred.\n");<br />
elseif  etc etc<br />

Is there a better way of capturing the text of the error rather than an if/else/else/else sequence?
Note: I am open to any type of suggestion. The goal is to read a CSV text file and parse it into a std::map.
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/

AnswerRe: CFileException, discover reasons Pin
Richard MacCutchan8-Jun-13 22:40
mveRichard MacCutchan8-Jun-13 22:40 
GeneralRe: CFileException, discover reasons RESOLVED Pin
bkelly139-Jun-13 4:54
Memberbkelly139-Jun-13 4:54 
GeneralRe: CFileException, discover reasons Pin
bkelly139-Jun-13 7:11
Memberbkelly139-Jun-13 7:11 
GeneralRe: CFileException, discover reasons Pin
Richard MacCutchan9-Jun-13 10:23
mveRichard MacCutchan9-Jun-13 10:23 
GeneralRe: CFileException, discover reasons Pin
bkelly139-Jun-13 10:43
Memberbkelly139-Jun-13 10:43 
GeneralRe: CFileException, discover reasons Pin
Richard MacCutchan9-Jun-13 21:41
mveRichard MacCutchan9-Jun-13 21:41 
Answertried FormatMessage() Pin
bkelly139-Jun-13 8:07
Memberbkelly139-Jun-13 8:07 
AnswerStill looking for reason text Pin
bkelly1322-Jun-13 13:17
Memberbkelly1322-Jun-13 13:17 
GeneralRe: Still looking for reason text Pin
Richard MacCutchan23-Jun-13 1:51
mveRichard MacCutchan23-Jun-13 1:51 
GeneralRe: Still looking for reason text Pin
bkelly134-Jul-13 12:05
Memberbkelly134-Jul-13 12:05 
GeneralRe: Still looking for reason text Pin
Richard MacCutchan4-Jul-13 21:50
mveRichard MacCutchan4-Jul-13 21:50 
QuestionHow to force C++ allocate memory from disk? Pin
Falconapollo8-Jun-13 0:49
MemberFalconapollo8-Jun-13 0:49 
AnswerRe: How to force C++ allocate memory from disk? Pin
MicroVirus11-Jun-13 1:13
MemberMicroVirus11-Jun-13 1:13 
GeneralRe: How to force C++ allocate memory from disk? Pin
Falconapollo11-Jun-13 1:19
MemberFalconapollo11-Jun-13 1:19 
NewsProblem when apply cilk_for with ippiFFT of intel parallel Pin
tunheo6-Jun-13 0:37
Membertunheo6-Jun-13 0:37 
QuestionRemove COM Objects from VC++ projects Pin
Prashant Gupta 2413-Jun-13 21:05
MemberPrashant Gupta 2413-Jun-13 21:05 
AnswerRe: Remove COM Objects from VC++ projects Pin
Richard MacCutchan3-Jun-13 22:01
mveRichard MacCutchan3-Jun-13 22:01 

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.