I am developping a multithreaded library in C++, which I compile then to a DLL.
For convenience, I use to name my worker threads with the following method provided by the msdn website : http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx Although I don't get exactly how it works, it does works like a charm as long as I load my DLL among a C++ project.
Now if I want to use it in a C# project, VisualC# breaks on the following line of the sample:
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
with this message:
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in myLibrary.dll
Additional information: External component has thrown an exception.
I unticked every kind of exception in Debug
>Exception
, but VC# still breaks on this line, then quit my app.
Is there a way of naming thread that is "inter-language-safe"?
Thank you