Problem with CException

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alain M. Dube (adube_at_cadencesoftware.com)
Date: 12/03/04


Date: Thu, 2 Dec 2004 22:12:47 -0500

Hello;

I'm running Windows XP Professional, SP2. I'm using Microsoft Visual C++ v6
(SP5). I built a sample project using the App Wizard. The sample app is
uses dynamic bound MFC, and is a Single Doc Interface Windows app.

I placed the following code in the main cpp file (say after the app
initialization takes place):

try
{
    char* psz = NULL; // Setup a NULL pointer
    *psz = 0; // Attempt to set the location at address
0 to 0 - to force an Access Violation
}
catch (CException* pEx)
{
    int x = 1;
}

Looks simple enough.

When I run execute the app, a message is displayed referring to an
"unhandled exception" after the "*psz = 0;" instruction is executed. My
"catch" exception handler never gets control. The Access Violation is
"unhandled".

What could cause my exception handler to be ignored?

Thanks in advance for your assistance.

Regards;

Al



Relevant Pages

  • Re: Mac vs PC
    ... If by "Apple Microsoft OS emulator" you mean Bootcamp, ... Installing and running Windows on this second partition is not ... Bootcamp created Windows partition. ... It's really very cool to be able to run any OS X app, any Windows app, ...
    (rec.boats)
  • Re: error and needs to close
    ... Mark L. Ferguson ... > Running Windows XP Home Edition, ... > App Name: Explorer.exe ...
    (microsoft.public.windowsxp.help_and_support)
  • Slow opening Apps
    ... My PC is 1.5 years old and running Windows XP. ... takes around 20 seconds to open any app. ... hard disk activity while I'm waiting. ... so to load the very first time and subsequently. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Uh Oh... Prof requires ms word format
    ... Your professor is running windows and cares about file size. ... very handy windows app which can read _all files_ which a linux app can ... about postscript is that you can translate it to Adobe's Portable Data ... Format (PDF) and the windows program I'm talking about would be Adobe's ...
    (Debian-User)
  • Re: proportional fill using multiple files
    ... > I would love to;)...heck we are still running windows 2000... ... > reasons I am putting so much effort into measuring performance is so I ... > finished my .Net app today...I call it the DBJammer. ... > threads at A time and the other pool fires of queries against the data ...
    (microsoft.public.sqlserver.server)