|
-
March 13th, 2009, 05:16 AM
#1
try catch(...) problem in VC++
Hello everyone,
I have a VS solution with a C# windows application and a VC++ dll which exports a function.
In that function (from the dll) I have a try catch block like this:
try{
//do something
int a =0;
int b = 100/a;
//do something else
catch(...)
{
//Log this exception
}
the prblem is that the exception is caught from the C# application. The dll (which exports a function) is imported in the C# application like this:
[DllImport("Huffman", EntryPoint = "StartToArchive")]
private static extern void StartToArchive(string from, string to, StatusCallBackDelegate statusCallback);
Do you have any ideas how can the exception (error division by 0) can be managed by the try catch block from the C++ dll without throwing an error in C#?
This code is just an example. I don't look for answers like test before the third line if a != 0.
The C++ dll is unmanaged code.
Last edited by lunguIonut; March 13th, 2009 at 05:21 AM.
Reason: Forgot to say.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|