在 Visual Studio 2010 中实现安装项目后使用 new 时出现 unhandlex 异常
我有我的小客户端应用程序,它在启动时通过“new”在堆上创建一些用户定义的对象,
pHistory = new CHistory;
这没有问题,直到昨天一切都运行良好。
我想部署我的应用程序,并决定使用 Visual Studio 2010 中的“安装项目”。 http://msdn.microsoft.com/en-us/library/dd293568.aspx
但是几分钟前,当我尝试运行该程序时(昨天部署后我没有做任何更改),它抛出一个未处理的异常
0x55b259da 处未处理的异常 CLient.exe 中的(msvcr100d.dll): 0xC0000005:读取访问冲突 位置 0xccccccc0。
我无法想象,为什么......我已经从解决方案中删除了安装项目,但这并没有改变任何东西...... 如果安装项目对项目设置进行了一些更改,我不知道在哪里以及什么...
有人熟悉这一点或可以提供帮助吗?
谢谢。
编辑:当我通过 Visual Studio 调试应用程序时会发生这种情况...而不是在我部署它的另一台计算机上!!!
I have my little client application which - when started - creates some user defined objects on the heap via "new"
pHistory = new CHistory;
This was no problem and everything ran fine until yesterday.
I wanted to deploy my application and did decide to use a "Setup Project" from Visual Studio 2010. http://msdn.microsoft.com/en-us/library/dd293568.aspx
But a few minutes ago, when I tried to run the program ( I did not do any changes after the deployment yesterday ), it throws an unhandled exception
Unhandled exception at 0x55b259da
(msvcr100d.dll) in CLient.exe:
0xC0000005: Access violation reading
location 0xccccccc0.
And I can not imagine, why... I already deleted the Setup Project from the solution, but that did not change anything...
If there are some changes in the project settings, made by the Setup project, I don´t know where and what...
Is anyone familiar with this or may help?
Thank You.
EDIT: this happens when i debug the application via visual studio... not on another computer where i deployed it!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
调试版本始终使用值 0xcccccccc 初始化局部变量,旨在让程序在尝试使用未初始化的变量时崩溃。这工作得很好,总是很高兴能够诊断代码中的错误,这些错误会导致交付的产品出现随机故障。
这当然与您的安装项目无关。使用调试器找出错误所在的位置。调用堆栈应该是关于哪个指针无效的主要提示。
The debug build always initializes local variables with the value 0xcccccccc, designed to let your program crash when it tries to use an uninitialized variable. That's working well, always nice to get a diagnostic for a bug in your code that will cause random failure in the shipped product.
This of course has nothing to do with your setup project. Use the debugger to find out where the bug is located. The call stack should be a major hint as to what pointer is invalid.
看起来像是未初始化的内存。
当您开始准备分发它时,您是否从调试版本更改为发布版本?
Looks like uninitialised memory.
Did you change from debug to release builds when you started getting ready to distribute it?
我对这个问题的新手修复是创建一个新的解决方案并将每个文件从旧的文件插入到这个新的文件中。
现在工作正常...
但我仍然不确定是什么导致了这个问题...我仍然相信由于设置项目而导致的原因...但其他回答者告诉我这不是原因:/。 ..
My newbie fix to this problem is to create a new solution and insert every file from the old one to this new one.
It works fine, now...
But I am still not sure what caused this problem... I am still believing in the cause due to the setup project... but the other answerers told me it is not the cause :/...