You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
, user can actually get what was wrong with the his call, if it fails, just by calling System.Runtime.InteropServices.Marshal.GetLastWin32Error() or better - by creating and\or throwing System.ComponentModel.Win32Exception().
Without SetLastError, trying to call GetLastWin32Error() after obviously failed winapi call (it returned zero) returns error code 0 ("The operation completed successfully"), as if no error occured.
Hi @akastalker that sounds like good advice, let me pencil this in for the next release and look over the documentation and any impact it will have in other areas - thanks for raising this issue!
Hi @dwmkerr! I implemented the SetLastError for all dll imports in the core project. All samples are working fine. I will do some performance tests now with the performance test suite. If I get it running... :) Please find my changes in the pull request for branch Issue43-SetLastError.
Hi @dwmkerr! I cannot really say something about the performance this time. I tried to execute the test suite. I run it with the nunit test runner gui. But there is only one test and I don't know, if this test make sense. What is the approach for performance testing and how does the test project fits into? The test project is not open source?
If every imported function (that potentially can fail) in SharpGL.Win32 namespace will be changed from:
to:
, user can actually get what was wrong with the his call, if it fails, just by calling System.Runtime.InteropServices.Marshal.GetLastWin32Error() or better - by creating and\or throwing System.ComponentModel.Win32Exception().
Without SetLastError, trying to call GetLastWin32Error() after obviously failed winapi call (it returned zero) returns error code 0 ("The operation completed successfully"), as if no error occured.
See remarks section on: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getlastwin32error%28v=vs.100%29.aspx
The text was updated successfully, but these errors were encountered: