为什么运行时间错误!? [英] Why RunningTime Error!?

查看:126
本文介绍了为什么运行时间错误!?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用vs2008使我的代码在调试和发行版本中都能正常工作.但是,当我将.exe和相关文件(包括MFC&CRT90 DLL)复制到另一个文件文件夹时,它不起作用!它演示了一个ErrorDlg,上面写着此应用程序已请求运行时终止它..."任何人都可以帮助我!

I Use vs2008 to make my code in both debug and release,work well.But When I copy the .exe and the relative files(including MFC&CRT90 DLLs) to a different filefolder,it doesn''t work! It demonstrate a ErrorDlg says"this application has requested the RunTime to terminate it....." AnyOne Help me!

推荐答案

它不再是一个好东西了.复制MFC和运行时DLL的想法几乎与您的程序无关.现在,许多这些DLL都已通过清单系统进行注册和跟踪.

而是使用适合您所使用的Visual Studio版本的运行时安装程序.这样可以确保所需的MFC和运行时DLL正确加载了它们的依赖关系,并正确注册.

不要将程序的调试版本复制到其他系统.那会给您带来很大的麻烦.如果需要进行远程调试,请使用调试信息构建发布代码,然后将远程调试器链接到pdb文件.
It''s no longer a good idea to copy the MFC and Run time DLLs willy nilly around with your program. Many of these DLLs are now registered and tracked through the manifest system.

Instead, use the the appropriate runtime installer for the version of Visual Studio you are using. This will make sure that the MFC and runtime DLLs you need are properly loaded with their dependancies, and properly registered.

Don''t copy debug versions of your program to other systems. That will open up a big can of headaches for you. If you need to do remote debugging, then build your release code with debug info and link the remote debugger to your pdb files.


实际上,可能有很多原因.通常,这是一种缺少的资源,例如dll,程序文档,数据文件或任何程序依赖的文件.也可能发生这种情况,因为该程序将静态路径写入注册表或.ini文件,从而导致安装错误.

在不了解更多程序的情况下,很难给出明确的指针.
There can actually be a number of reasons for this. Most often it''s a missing resource e.g. dll, program document, data files, or whatever your program depends upon. It can also happen because the program writes static paths to the registry or .ini file, making it an installation error.

Without knowing more of your program, it''s hard to give explicit pointers.


如果您确定所有所需的dll都存在,则可能由于多种原因而发生.但是如果是由于缺少dll而造成的,则将是另一个错误),然后检查动态内存是否未使用.

例如
您可能有一个接收文本的文本框.然后将文本从该文本框中移动到另一个char数组.说char数组的长度是x.一个普遍的错误是,每次测试代码时,您插入的数据长度小于x,但是可能是当您开始插入实数据时,您输入的长度大于x,所以发生的次数很多.
It can happen for lots of reason, if you are sure that all of your required dlls are there(Even though if it was because of missing dlls then it would be another error) then check for your miss use of dynamic memory.

as example
you may have a text box that receive text. then you move text from that text box to another char array. say the length of char array is x. Its a common mistake that every time you test your code you insert data smaller than length x, but may be when you started to insert real data then you are putting more than length x, it happens a lot.


这篇关于为什么运行时间错误!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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