且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

运行MFC应用程序时出现VC ++运行时错误

更新时间:2021-09-29 03:12:58

正如 Jochen 正确指出的那样,您应该得到类似于以下内容的编译器错误:
As correctly noted by Jochen, you should get a compiler error similar to:
Error   'LoadArchive' : undeclared identifier


(因为LoadArchive超出了try块的范围).
如果不这样做,那么您先前的代码中还有另一个 LoadArchive,并且...,您看到问题了吗?


(because LoadArchive is out of scope outside the try block).
If you don''t, then there is another LoadArchive in your previous code and..., do you see the problem?


哦,实际上,错误,我在"LoadArchive.Close()"之前加上了右括号.它不在那里.而且我的代码在执行"LoadArchive.Close()"语句时给出了运行时错误.后来我发现它抛出异常.因此,我为此语句添加了另一个try catch块.现在代码可以正常工作了.但是我无法准确找到它引发的异常.
感谢您的评论.
Oh actually by mistake i put closing parenthesis before "LoadArchive.Close()". Its not there. And my code gives runtime error while executing "LoadArchive.Close()" statement. Later i found it is throwing exception. So i put another try catch block for this statement. Now code is working fine. But i could not able to find exactly which exception it is throwing.
Thanks for comments.