编了一个基于对话框的套接字mfc程序,vs2015,可以正常调试运行,我把跟这个程序有关的整个文件夹,从一个位置拷贝到了同一台电脑的另一个位置,调试时报错,"Debug Assertion Failed!"请问大神是什么原因?

解决方案 »

  1.   

    如果你程序里面用的都已经是相对路径了,还出错,那么就要看看你的支持库了,是不是两台电脑的环境不同,有一些支持库比如opencv一类的并没有配置全?
      

  2.   

    崩溃的时候在弹出的对话框按相应按钮进入调试,按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. Res
    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  
      

  3.   

    应该是某个句柄创建不成功,参数为NULL,查看“Debug Assertion Failed!” 时的上级调用者,往上追溯是哪个句柄或者指针为NULL