Archived

This topic is now archived and is closed to further replies.

AlekM

Problem with Handling Exceptions

Recommended Posts

Hi Just wondering if anyone has had problems handling exceptions correctly in VC6.0 and the latest service pack. I had the following line of code before the service pack and it worked correctly.
            
void CDXBitmap::Load( String strSource )
{
    // Cope Implementation for loading a bitmap from file 

    if ( !fsStream )
    {
        throw CBitmapException( __FILE__, __LINE__, 
              CBitmapException::FILE_NOT_FOUND,
              "Unable to load bitmap. File not found.",
              "void CDXBitmap::Load( String strSource )"); 
    }
}
[/source]

[source]
void CDXBitmap::Load( String strSource )
{
    // Cope Implementation for loading a bitmap from file 

    if ( !fsStream )
    {
        throw new CBitmapException( __FILE__, __LINE__, 
              CBitmapException::FILE_NOT_FOUND,
              "Unable to load bitmap. File not found.",
              "void CDXBitmap::Load( String strSource )"); 
    }
}
    
The first worked correctly up until I installed the latest MS service pack. After the service pack, this code would compile and link correctly, but when I encountered an exception, the data in the exception did not get copied correctly. They were not initialized. I had to change the code to use pointer exceptions for it to work. Any Ideas? AlekM Edited by - AlekM on 7/21/00 1:48:33 PM

Share this post


Link to post
Share on other sites