Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6107305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:10:27+00:00 2026-05-23T14:10:27+00:00

In the release version of my code one line is throwing an exception and

  • 0

In the release version of my code one line is throwing an exception and I don’t know what type of exception it is so I can’t catch it correctly or figure out the problem.

I using the catch(…) but that’s pretty much worthless.

here is some pseudo code

 try
  {
    m_mmwIPC = gcnew NiftyIPC(gcnew String("Monitor"), true);
  }
  catch (CException* e)
  {
    TCHAR   szCause[255];
    e->GetErrorMessage(szCause, 255);
    CString errorStr = szCause;
    RemoveLineFeeds(errorStr);
    OutputDebugString(errorStr);
  }
  catch(...)
  {
    OutputDebugString(L"Unknown exception\n");
  }

So, is there any way to get any details on the thrown unknown exception? Just a type would be great.

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:10:27+00:00Added an answer on May 23, 2026 at 2:10 pm

    Not really, it could be an int, a const char* or a RhubarbPie über-smart pointer.

    However:

    • Try catching std::exception too. That will catch a lot of C++ native exceptions.
    • Your exception is probably a .NET one, so try to catch that one, not the MFC Base exception. (It looks like you’re doing C++/CLI. In that case, .NET-exceptions end up in the catch-all clause)
    • Also, exceptions are usually meant to be caught by reference in C++
      (Update: MFC apparently uses throw-and-catch by pointer. That works too, as long as you catch what is thrown.)
    • It might also help to use __try and __catch, since some “hardware” exceptions like stack-overflow, access violation, etc, are also unknown exceptions on Windows. The syntax for catching them are a bit differently, but you get an exception identifier that can be used to report the type of exception thrown. I use that to print stack-traces on fatal errors in our apps.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded a pre-release version of the iPhone SDK and tried to update one
When do you think we can expect the full release version of ASP.NET MVC?
We use git to manage our code, and just create one tag when release
PHP version 5.3 has been released, and although it looks great, all my code
I just downloaded the release version of MVC 2, pretty excited about that! Problem
Using the release version of Visual Studio 2010 I think there's a difference in
I want to deploy the release version of my application done in C#. When
I have downloaded the ASP.NET MVC 2 Release version (using Web Platform Installer) as
We are about to release beta version of our website. Lately we have seen
According to the official release statement version 1.4 has been re-written to be compressed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.