Link to home
Start Free TrialLog in
Avatar of javanic
javanic

asked on

ShowDialog() causes SEHException: Why???

Hi all,

Here's the sequence of events for this problem I'm having:
1) I have no SEHExceptions
2) I add a class to my project containing __event declarations
3) I add code in another class to subscribe to the events in the new class
4) An old dialog box, one that has been closing without any hiccups for many months, suddenly throws an SEHException whenever it closes.
5) If I undo all __event declarations and comment out the subscribing and handling code the problem goes away.

I've been googling this problem for a few hours and find that most occurrences of this problem resulted from adding the EnableVisualStyles call in code. However, in my case, I am not doing that. I had never heard of EnableVisualStyles before I began googling for this problem.

Does anyone know how to identify the source of this particular SEHException? I can't even catch the exception with try{} catch(System::Runtime::InteropServices::SEHException * e) {}. I'm stumped and my boss is not happy because this problem is holding up my scheduled release.

Any help is much appreciated.

javanic
Avatar of javanic
javanic

ASKER

Well, this problem has gone away for me. I changed several settings in my C/C++ compile property pages (in MS 2003 .NET IDE) and the problem went away. I wish I could say exactly which of the changes solved the problem, but I can't. I tried to undo each of the changes one by one to find the culprit, but I could not duplicate the problem with those changes.

I had noticed that several of my settings were not the default ones for a .exe product. I simply selected the <inherit from project type> option and recompiled.

If there's a lesson here it is: don't mess with the compile options unless you know exactly what you are doing. Just take the project type defaults when possible.

To the area admins, I suggest this be PAQ'd and closed with points refunded.
ASKER CERTIFIED SOLUTION
Avatar of GhostMod
GhostMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial