I've written an ActiveX control in C++ that throws (C++) exceptions out when error conditions occur within the control. The Javascript code that invokes the object representing an instance of the control is surrounded by a try - catch block:
try
{
var controlInstance = window.controlInstance;
... perform operations on controlInstance ...
}
catch (e)
{
alert("something bad happened");
}
Now, when I run this code under IE8 (or 7 or 6) with a Visual Studio (2008) debugger attached to it, everything works as expected - whether the control is compiled with or without DEBUG on. However, when running the browser without a debugger attached, IE crashes (really) when an exception crosses the boundary between the control and JScript.
Does anyone have any suggestions around how to solve this problem? I realize that I can change the control's interface to pass the exception back as an argument but I really would rather not make such a change.
Any help would be appreciated.