mfc同一台电脑,不同位置,调试运行报错!

houjiahong 2018-05-04 04:21:28
编了一个基于对话框的套接字mfc程序,vs2015,可以正常调试运行,我把跟这个程序有关的整个文件夹,从一个位置拷贝到了同一台电脑的另一个位置,调试时报错,"Debug Assertion Failed!"请问大神是什么原因?
...全文
1022 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
worldy 2018-05-07
  • 打赏
  • 举报
回复
应该是某个句柄创建不成功,参数为NULL,查看“Debug Assertion Failed!” 时的上级调用者,往上追溯是哪个句柄或者指针为NULL
赵4老师 2018-05-07
  • 打赏
  • 举报
回复
崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack即“调用堆栈”里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处,看不懂时双击下一行,直到能看懂为止。 SetCurrentDirectory The SetCurrentDirectory function changes the current directory for the current process. BOOL SetCurrentDirectory( LPCTSTR lpPathName // pointer to name of new current directory ); Parameters lpPathName Pointer to a null-terminated string that specifies the path to the new current directory. This parameter may be a relative path or a fully qualified path. In either case, the fully qualified path of the specified directory is calculated and stored as the current directory. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. Remarks Each process has a single current directory made up of two parts: A disk designator that is either a drive letter followed by a colon, or a server name and share name (\\servername\sharename) A directory on the disk designator QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Unsupported. Header: Declared in winbase.h. Import Library: Use kernel32.lib. Unicode: Implemented as Unicode and ANSI versions on Windows NT. See Also File I/O Overview, File Functions, GetCurrentDirectory
白色一大坨 2018-05-04
  • 打赏
  • 举报
回复
引用 3 楼 phenix2009 的回复:
如果你程序里面用的都已经是相对路径了,还出错,那么就要看看你的支持库了,是不是两台电脑的环境不同,有一些支持库比如opencv一类的并没有配置全?
一台电脑啊,看错了,那么我推测就是路径问题了,请检查程序里面是不是用了绝对路径
白色一大坨 2018-05-04
  • 打赏
  • 举报
回复
如果你程序里面用的都已经是相对路径了,还出错,那么就要看看你的支持库了,是不是两台电脑的环境不同,有一些支持库比如opencv一类的并没有配置全?
白色一大坨 2018-05-04
  • 打赏
  • 举报
回复
断言错误,那么你要找一下报错的地方,你确定你在两台电脑上的资源是一致的? 也许你使用了一下保存为绝对路径的资源,但并未将那些资源拷贝到另外一台电脑上。
半雨微凉丶 2018-05-04
  • 打赏
  • 举报
回复
中止,调出堆栈一看就知道了,这个一般只能自己来调试

18,357

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧