> So, Oleg, my question to you is, "Does what Carl suggests solve the
> problem?" If it does, what's the right way to do it?
Yes, it does, but only for native C++ exceptions, while your application
seems to use managed exceptions. Managed exceptions can be thrown/caught
across message pumps.
(In case of native exceptions, my solution would be to catch everything that
I know should be caught before it can potentially cross CRT boundaries
(that is, do not allow native C++ exceptions that are used by my code
to leave the message handlers). I would leave everything else to the default
just-in-time debugging mechanism).
> Another question to you, Oleg, is that the article you cited
> (http://support.microsoft.com/default.aspx?scid=kb;en-us;836674) seems
> to be talking about this in terms of SEH rather than C++ exceptions.
It is talking about managed exceptions. It applies to System::Exception
and types derived from it. Btw, how is your exception class (MyException) defined?
> Another point of confusion that I have is that the article you cited
> says "In Visual Studio .NET 2003, click Application Configuration File
> under Template, and then click Open". Well, I'm running 2003 and there
> is no Application Configuration File under Template. There's a resource
> template icon but no "XML file" under it. Sigh.
Create the file manually, name it yourapp.exe.config and place it into the same
directory with yourapp.exe (substitute the real name, of course :)
The file should contain the following:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
This should change the behavior of your application when running without debugger
(your handler will be able to catch the exception).
Oleg
RalphTheExpert - 14 Nov 2005 17:40 GMT
Oleg:
[snip]
>It is talking about managed exceptions. It applies to System::Exception
>and types derived from it. Btw, how is your exception class (MyException) defined?
/* MyException.h */
#pragma once
#using <mscorlib.dll>
public __gc
class MyException: public System::Exception
{
public:
/*
Constructors, private methods, and other stuff.
Oleg, do you need/want the full class?
*/
}; /* class MyException: System::Exception */
>> Another point of confusion that I have is that the article you cited
>> says "In Visual Studio .NET 2003, click Application Configuration File
[quoted text clipped - 13 lines]
>This should change the behavior of your application when running without debugger
>(your handler will be able to catch the exception).
Thanks!
Is it my imagination, but does it take a very long time for the
executable to load the first time it is loaded when I put in
myApp.exe.config?
>Oleg
Ralph
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com