What does HRESULT 0x80070057 mean, and why is my program crashing?

二次信任 提交于 2019-12-31 04:29:07

问题


I've written a program that takes two images, then runs an algorithm on them to isolate a hand in the "foreground" and match the gesture to a known one.

A few days ago, I ran the program with some test parameters, just to test a few tweaks I had made, and it all worked fine. I have not touched the code since then.

Today, I ran the program with two new images, and it crashed, giving me the error code 0x0 and HRESULT=0x80070057. Beyond this, when I stopped debugging from C# Visual Studio 2010 Express, somehow, the debugging stopped, according to studio. But the form is still up, unresponsive, and unable to be closed, even from Task Manager. I can't run the program, because it says another instance is still running.

What could be causing this? And what can I try to fix it? I'd be happy to provide any other details that might be helpful; I'm relatively inexperienced and don't really know what is and isn't helpful.

Addition: I stopped and started studio, and that seems to have fixed the problem. Still, if someone can explain what may have happened, it would be much appreciated.

Another detail: The program crashed near the end of what it was supposed to do. I was able to start, load both pictures, and run the algorithm, but in the last step, it crashed on me.


回答1:


From what I know the error code means, that an assembly couldn't be loaded. It is corrupt or not avaliable.

Clear the \bin folder of your project and the AppData (Temp) folder (located at C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET) and see if the error still happens.

Source MSDN

E_INVALIDARG: One or more arguments are not valid (0x80070057)




回答2:


You may be using an assembly that couldn't be loaded correctly. For checking which one may fail I would recommend you this utility: http://www.dependencywalker.com/

It scans your app for dependencies and highlight the ones that were not found. In my case was a C++ assembly that was missing.



来源:https://stackoverflow.com/questions/14148543/what-does-hresult-0x80070057-mean-and-why-is-my-program-crashing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!