+ Reply to Thread
Results 1 to 2 of 2

Thread: Program crashes in Debug mode even if try catch is written. Why?

  1. #1

    Program crashes in Debug mode even if try catch is written. Why?

    Hi All,

    I have following code:

    Code:
    void GenerateCrash()
    {
    	try
    	{
    		char *p = NULL ;
    		*p = NULL ;
    	}
    	catch(...)
    	{
    		OutputDebugString("caught a crash...\n") ;
    	}
    }
    Even if try and catch(...) is written, it crashes. Why?

    What is the reason?

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Posts
    109
    You can use "Yes With SEH Exceptions (/EHa)" option if you use Visual Studio 2005.

    This should resolve your issue.

    For more information:
    http://msdn.microsoft.com/en-us/library/1deeycx5.aspx

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts