Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionerror C2065: '_Application' : undeclared identifier Pin
Davitor5-Jul-09 20:09
Davitor5-Jul-09 20:09 
AnswerRe: error C2065: '_Application' : undeclared identifier Pin
Stuart Dootson5-Jul-09 21:52
professionalStuart Dootson5-Jul-09 21:52 
GeneralRe: error C2065: '_Application' : undeclared identifier Pin
Davitor6-Jul-09 0:27
Davitor6-Jul-09 0:27 
QuestionRe: error C2065: '_Application' : undeclared identifier Pin
David Crow6-Jul-09 3:45
David Crow6-Jul-09 3:45 
QuestionException Handling using catch(...) [modified] Pin
vijay.victory5-Jul-09 20:05
vijay.victory5-Jul-09 20:05 
AnswerRe: Exception Handling using catch(...) Pin
Cedric Moonen5-Jul-09 20:30
Cedric Moonen5-Jul-09 20:30 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory5-Jul-09 20:35
vijay.victory5-Jul-09 20:35 
AnswerRe: Exception Handling using catch(...) [modified] Pin
Stuart Dootson5-Jul-09 21:50
professionalStuart Dootson5-Jul-09 21:50 
Note the documentation[^] - CRecordset::Open can throw exceptions of type CDBException* and CMemoryException* - i.e. POINTERS to exception objects, not exception objects. MFC throws pointers because when it was written, the Microsoft C++ compiler didn't do exceptions (not properly, at least), so MFC had its own exception handling functionality.

Change your exception handlers to the code below (note the exception signature and the added exception object deletion lines) and you should be good.

catch(CDBException* cdb)
{
   MessageBox(NULL,cdb.m_strError ,"fnInitFromFile_CDBException",0);
   cdb->Delete();
}
catch(CException* ce)
{
   AfxMessageBox(ce.ReportError());
   AfxMessageBox("CException..inside fnInitFromFile");
   ce->Delete();
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

modified on Monday, July 6, 2009 5:30 AM

GeneralRe: Exception Handling using catch(...) Pin
vijay.victory5-Jul-09 23:27
vijay.victory5-Jul-09 23:27 
GeneralRe: Exception Handling using catch(...) Pin
Stuart Dootson5-Jul-09 23:45
professionalStuart Dootson5-Jul-09 23:45 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory6-Jul-09 0:13
vijay.victory6-Jul-09 0:13 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory6-Jul-09 0:44
vijay.victory6-Jul-09 0:44 
QuestionMFC multi-views print Pin
windyhigh5-Jul-09 18:19
windyhigh5-Jul-09 18:19 
AnswerRe: MFC multi-views print Pin
windyhigh5-Jul-09 22:05
windyhigh5-Jul-09 22:05 
QuestionDesign suggestion and the decorator design pattern Pin
The_Bob5-Jul-09 12:29
The_Bob5-Jul-09 12:29 
QuestionMy Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock5-Jul-09 5:03
pavarathyRock5-Jul-09 5:03 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
Iain Clarke, Warrior Programmer5-Jul-09 6:31
Iain Clarke, Warrior Programmer5-Jul-09 6:31 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot5-Jul-09 7:54
harold aptroot5-Jul-09 7:54 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock6-Jul-09 5:22
pavarathyRock6-Jul-09 5:22 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot6-Jul-09 5:30
harold aptroot6-Jul-09 5:30 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock6-Jul-09 6:11
pavarathyRock6-Jul-09 6:11 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot6-Jul-09 6:44
harold aptroot6-Jul-09 6:44 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
David Crow5-Jul-09 11:46
David Crow5-Jul-09 11:46 
Questionint in CListBox Pin
prithaa5-Jul-09 3:47
prithaa5-Jul-09 3:47 
AnswerRe: int in CListBox Pin
Sarath C5-Jul-09 4:26
Sarath C5-Jul-09 4:26 

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.