How to Determine the Type of Exception?

  • Thread starter Thread starter chcw
  • Start date Start date
C

chcw

Guest
Hi



When debugging program in Visual C++ 2008, I get an exception said “Microsoft C++ exception: COleDispatchException at memory location 0x####”. Based on this info, I add a try-catch block as follows:



try

{





Do something



}

Catch(COleDispatchException& e)

{

}



But this does not catch the exception. Then I change the parameter from COleDispatchException& to COleDispatchException*, as follows:



try

{





Do something



}

Catch(COleDispatchException* e)

{

}



Then I will be able to catch the exception. So I just wonder how to know the exception type beforehand, to prevent taking time to guess the type?

Continue reading...
 
Back
Top