Delphi XE - EOleSysError,但只有在IDE / debugger中运行时 [英] Delphi XE - EOleSysError, but only when running in IDE/debugger

查看:621
本文介绍了Delphi XE - EOleSysError,但只有在IDE / debugger中运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在XE论坛上看到了同样的问题,但仍然没有回答。我从XE IDE运行我的应用程序,并得到一个EOleSysError - '系统找不到指定的路径'。



可以出去探索到同一个目录,并在IDE外部运行相同的应用程序,它运行良好。没有错误。我的所有程序集都位于应用程序的构建目录中,所以我不依赖于GAC或任何东西,只是可执行文件的目录。



这是一个XE和Windows 7 x64的已知错误?



这是路径问题吗?环境变量问题?它似乎IDE正在从另一个目录运行我的exe,但exe只在一个地方编译。



任何帮助在这里将不胜感激。 >

感谢,



Rick

解决方案

这不是一个bug。调试器捕获异常,并让它知道它在它传递给代码中的异常处理程序之前。



如果你想避免这种情况发生,你可以做一些事情:




  • (最简单)在引发异常之前的行上设置断点。右键点击该线,然后从上下文菜单中选择断点属性。点击高级... 按钮,然后取消选中暂停复选框,并选中忽略后续例外复选框,然后点击确定以关闭对话框。在引发异常之后在行上设置断点,并重复上述过程,但此时请检查处理后续异常复选框。我说这是最简单的,因为你可以通过禁用断点来禁用它来打破异常,并通过删除断点完全删除它,并且你得到一个可视的指示符,代码块的东西是不同的。


  • 工具 - >选项中,禁用所有 EOleSysError 菜单中,找到 Debugger Options-> CodeGear / Embarcadero Debuggers-> Language Exceptions ,并将 EOleSysError 添加到对话框,并确保项目已选中。


  • 只需点击异常对话框中的继续按钮,并让代码继续运行。这有点恼人,例如当你在一个循环中运行代码,并且循环中的东西引发异常;



I have seen other questions with this same problem on XE Forums, but still no answer. I run my application from with the XE IDE and I get an EOleSysError - 'The system cannot find the path specified'.

But, I can go out to explorer to the same directory and run that same app outside the IDE and it runs fine. No errors. All of my assemblies are located in the build directory of the application, so I'm not relying on GAC or anything, just directory the executable is in.

Is this a known bug with XE and Windows 7 x64?

Is this a path problem? Environment variable issue? It almost seems like the IDE is running my exe from another directory, but the exe is only being compiled in one place.

Any help here would be appreciated.

Thanks,

Rick

解决方案

It's not a bug at all. The debugger is catching the exception, and letting you know about it before it passes it to the exception handler in the code. It's working by design, letting the developer know that the exception happened.

If you want to avoid this happening, you can do one of a few things:

  • (Easiest) Set a breakpoint on the line immediately before the exception is raised. Right-click the line, and choose Breakpoint properties from the context menu. Click the Advanced... button, and then uncheck the Break checkbox, and check the Ignore subsequent exceptions checkbox, and then click OK to close the dialog. Set a breakpoint on the line after the exception is raised, and repeat the process above, except this time check the Handle subsequent exceptions checkbox. I say this is easiest because you can disable it to break on the exception simply by disabling the breakpoints, and remove it entirely by just removing the breakpoints, and you get a visual indicator that something is different for that block of code.

  • Disable IDE error handling for all EOleSysError exceptions, from the Tools->Options menu, find Debugger Options->CodeGear/Embarcadero Debuggers->Language Exceptions, and add EOleSysError to the Exception types to ignore dialog, and make sure the item is checked. It's the way Indy's exceptions are prevented from stopping the debugger, for instance.

  • Just click the Continue button in the exception dialog, and let the code keep running. This gets a little annoying sometimes, such as when you're running code in a loop, and something in the loop is raising the exception; you keep getting the dialog over and over again.

这篇关于Delphi XE - EOleSysError,但只有在IDE / debugger中运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆