I'm getting a strange error on a SharpDX program I made.
The program contains one form MainForm
, which inherits from SharpDX.Windows.RenderForm
(I'm doing Direct3D 9). I have some logic that kills the program by calling MainForm.Close()
, and it works perfectly.
However, when I close the form with the X button, or by double clicking the top left corner of the screen, the program ends with code -1073610751 (0xc0020001).
This is a relatively minor annoyance, because it only happens when the program is finishing, so it doesn't really matter if it exits with an error, because it is actually finishing.
However, this error does not happen when I set a breakpoint at the last line of my Main()
. If I do so, and then close the window as I explained, the breakpoint gets hit, and resuming ends the program with code 0.
Apart from SharpDX and one pure C DLL I am calling to one-shot process some data, I am not doing mixed code, or any other weird stuff.
I've looked around, but this code appears to be related to string bindings? other people seem to have this problem when doing weird mixed C++/CLI stuff, but I'm not doing anything like that.
Any ideas? at least on how to get more concise information on this error code?
Dispose
of the objects created manually. What have you tried thus far..? – ScrofulaDispose
of, or an event handler you need to detach. I'm quite sure the error code is the same one in all cases (in this case) - both the string binding error, and the one I linked involve calls from COM (or unmanaged code) to managed code after the runtime has started shutting down. SharpDX is, indeed, purely managed code, but calling (and being called by) COM. – Thermodynamic