views:

69

answers:

1

I have in Visual Studio 2008 a .NET 3.5 C# project that uses a dll compiled from a C# project (let's call it dll A). Dll A is using on his turn some C++ libraries.

The problem is that when I encounter an error while calling objects from dll A, the application just closes, without showing any error. But I need to know what's the problem, I cannot just guess and go blind all along the project with this...

I checked Window's event log, could not find anything. I checked the settings of throwing errors in Visual Studio, in menu Debug - Exceptions, all of them are checked (including C++ exceptions), so, any errors should be thrown.

My code looks something like this:

tessnet2.Tesseract tessocr = new tessnet2.Tesseract();
tessocr.Init(@"s:\temp\tessdata", "eng", false);
tessocr.GetThresholdedImage(bmp, Rectangle.Empty).Save("s:\\temp\\" + Guid.NewGuid().ToString() + ".bmp");
List<tessnet2.Word> words = ocr.DoOCR(bmp, "eng"); //App exits at this line

If I put in my code something like

int x = Convert.ToInt32("test");

this should throw an error. And it throws, and Visual Studio shows it.

Does anyone having any idea why the errors are not being shown? Or where else could be registered?

Any help is very appreciated! Thanks!

+1  A: 

Did you activate unmanaged debugging in the property page of your C# project?

Without that, debug output from the C++ DLL wont make it to visual studio's output window.

Timbo
Thank you very much, that did the trick!
Diana