progeam:
file f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\filecore.cpp
line 295for information on how you program can cause an assertion failure,see the visual c++ on asserts
(press anykey to debug the application)接着点击忽略会出现 This application has requested the Runtime to terminate it in an unusual way.please contact the application's support team for more information. 我是.net 2005 c#工程 调用了一个VC的dll 我跟踪了是在调用过程用某一个语句发生的这个错误 这个语句是使AD卡开始工作之前没有这个问题 可以正常运行 但是昨天就这样子了 重装了机器还是一样 求助 谢谢

解决方案 »

  1.   

    原因很多,filecore.cpp295什么内容能看到否?
      

  2.   

    我在
    C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfcC:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\src\mfc
    搜索到了两个filecore第295行:是一个函数:
    ULONGLONG CFile::Seek(LONGLONG lOff, UINT nFrom)
    {
    ASSERT_VALID(this);
    ASSERT(m_hFile != INVALID_HANDLE_VALUE);
    ASSERT(nFrom == begin || nFrom == end || nFrom == current);
    ASSERT(begin == FILE_BEGIN && end == FILE_END && current == FILE_CURRENT);   LARGE_INTEGER liOff;   liOff.QuadPart = lOff;
    liOff.LowPart = ::SetFilePointer(m_hFile, liOff.LowPart, 
    #ifndef _WIN32_WCE
    &liOff.HighPart,
    #else // !_WIN32_WCE
    NULL,
    #endif // !_WIN32_WCE
      (DWORD)nFrom);
    if (liOff.LowPart  == (DWORD)-1)
      if (::GetLastError() != NO_ERROR)
       CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); return liOff.QuadPart;
    }
      

  3.   

    哦,那debug一下吧
    在C#项目属性中“启用调试项” 中一项:“启用非托管代码调试”,钩上这个
      

  4.   

    我把另一台机器的
    C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc\src\mfc
    下的filecore.cpp拷贝到其目录下 还是不行
      

  5.   

    勾选了 启用非托管
    出错后忽略出现下面提示:  中的 0x7c812aeb 
    处未处理的异常: Microsoft C++ 异常: 内存位置 0x0dfffa70 处的 CFileException。
    然后代码停留在
    C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlsimpstr.h
    这个头文件的下面的函数上
    void SetString( __in_ecount(nLength) PCXSTR pszSrc, __in int nLength )
    {
    if( nLength == 0 )
    {
    Empty();
    }
    else
    {
     
      

  6.   

     CFileException