Click here to Skip to main content
15,916,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: crash at vector::push_back. Pin
semitae11-Feb-10 1:28
semitae11-Feb-10 1:28 
QuestionHow can Get RECT value? Pin
Le@rner19-Dec-08 1:14
Le@rner19-Dec-08 1:14 
AnswerRe: How can Get RECT value? Pin
Stuart Dootson19-Dec-08 2:30
professionalStuart Dootson19-Dec-08 2:30 
QuestionRe: How can Get RECT value? Pin
CPallini19-Dec-08 2:37
mveCPallini19-Dec-08 2:37 
QuestionException handling in C++ Pin
San19-Dec-08 1:03
San19-Dec-08 1:03 
AnswerRe: Exception handling in C++ [modified] Pin
Jijo.Raj19-Dec-08 1:54
Jijo.Raj19-Dec-08 1:54 
GeneralRe: Exception handling in C++ Pin
Stuart Dootson19-Dec-08 2:24
professionalStuart Dootson19-Dec-08 2:24 
GeneralRe: Exception handling in C++ Pin
Jijo.Raj19-Dec-08 2:29
Jijo.Raj19-Dec-08 2:29 
Well Stuart, try with this code snippet. Its the same code snippet provided by Ron. I made it compilable. I'll be surprised if it didn't crashed in your system.

class MyErrorClass
{

char *reason;
int *i;

public:
   
   MyErrorClass(char *r)
   {
      i = new int[6];
      cout<<"Constructor"<<endl;
         reason = r;
      cout<<reason<<endl;
      
   }
   
   char* giveReason()
   {
      return reason;
   }
   ~MyErrorClass()
   {
      cout<<"destructor"<<endl;
      delete[] i;
   }
   
};
void main()
{
   
   try
   {
      throw MyErrorClass("error");
   }
   catch (MyErrorClass* e)
   {
      cout<<"Exception caught --- "<<e->giveReason()<<endl;
   }
}


Regards,
Jijo.

_____________________________________________________

http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

GeneralRe: Exception handling in C++ Pin
Stuart Dootson19-Dec-08 2:34
professionalStuart Dootson19-Dec-08 2:34 
GeneralRe: Exception handling in C++ Pin
Jijo.Raj19-Dec-08 2:41
Jijo.Raj19-Dec-08 2:41 
GeneralRe: Exception handling in C++ Pin
Stuart Dootson19-Dec-08 2:54
professionalStuart Dootson19-Dec-08 2:54 
GeneralRe: Exception handling in C++ Pin
Jijo.Raj19-Dec-08 3:25
Jijo.Raj19-Dec-08 3:25 
GeneralRe: Exception handling in C++ Pin
Stuart Dootson19-Dec-08 3:42
professionalStuart Dootson19-Dec-08 3:42 
AnswerRe: Exception handling in C++ [modified] Pin
Stuart Dootson19-Dec-08 2:27
professionalStuart Dootson19-Dec-08 2:27 
AnswerRe: Exception handling in C++ Pin
Stuart Dootson19-Dec-08 2:58
professionalStuart Dootson19-Dec-08 2:58 
QuestionHow to prevent ScrollBar hiding in a ScrollView Pin
pauvc19-Dec-08 0:50
pauvc19-Dec-08 0:50 
QuestionFSCTL_GET_VOLUME_BITMAP Pin
john563218-Dec-08 23:59
john563218-Dec-08 23:59 
AnswerRe: FSCTL_GET_VOLUME_BITMAP Pin
Jijo.Raj19-Dec-08 0:24
Jijo.Raj19-Dec-08 0:24 
GeneralRe: FSCTL_GET_VOLUME_BITMAP Pin
john563219-Dec-08 0:41
john563219-Dec-08 0:41 
GeneralRe: FSCTL_GET_VOLUME_BITMAP Pin
Jijo.Raj19-Dec-08 0:46
Jijo.Raj19-Dec-08 0:46 
GeneralRe: FSCTL_GET_VOLUME_BITMAP Pin
john563219-Dec-08 1:12
john563219-Dec-08 1:12 
QuestionHow to extract a substring from a string in visual c++ Pin
kapardhi18-Dec-08 22:01
kapardhi18-Dec-08 22:01 
AnswerRe: How to extract a substring from a string in visual c++ Pin
Cedric Moonen18-Dec-08 22:15
Cedric Moonen18-Dec-08 22:15 
AnswerRe: How to extract a substring from a string in visual c++ Pin
Iain Clarke, Warrior Programmer18-Dec-08 22:19
Iain Clarke, Warrior Programmer18-Dec-08 22:19 
AnswerRe: How to extract a substring from a string in visual c++ Pin
Hamid_RT18-Dec-08 23:18
Hamid_RT18-Dec-08 23:18 

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.