Advertisement

Problem with Handling Exceptions

Started by July 21, 2000 01:39 PM
-1 comments, last by AlekM 24 years, 5 months ago
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

This topic is closed to new replies.

Advertisement