DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Greg Guest

    Using MFC Exceptions in Console Applications


    I have a test program that uses the CFile class. When it fails to open a file
    (ie. when I have locked the file), it returns false. The error information
    is given to me in a CFileException object. When I try to format the message
    for this exception, an assertion is thrown because my program does not have
    a resource handle.

    I am assuming it is because I am using a console application, but how can
    I use the MFC exception frameowrk from my console application.

    Greg

  2. #2
    Danny Kalev Guest

    Re: Using MFC Exceptions in Console Applications

    why would you want to use MFC in a console app in the first place? I
    suggest that you use fstream objects instead and standard exception
    handling.

    Danny

    Greg wrote:
    >
    > I have a test program that uses the CFile class. When it fails to open a file
    > (ie. when I have locked the file), it returns false. The error information
    > is given to me in a CFileException object. When I try to format the message
    > for this exception, an assertion is thrown because my program does not have
    > a resource handle.
    >
    > I am assuming it is because I am using a console application, but how can
    > I use the MFC exception frameowrk from my console application.
    >
    > Greg


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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links