Debug Assertion Failed!
Program: d:\dd\err.exe
File:dbgheap.c
Line:1132
Expression: _CrtIsValidHeapPointer(pUserData)err是我的程序.程序是调用一个DLL, 在DLL的接口只添加一个参数char* op, 好奇怪的问题 

解决方案 »

  1.   

    The _CrtIsValidHeapPointer function is used to ensure that a specific memory address is within the local heap. The “local” heap refers to the heap created and managed by a particular instance of the C run-time library. If a dynamically linked library (DLL) contains a static link to the run-time library, then it has its own instance of the run-time heap, and therefore its own heap, independent of the application’s local heap. When _DEBUG is not defined, calls to _CrtIsValidHeapPointer are removed during preprocessing.
    改为release 版本!
      

  2.   

    应该是exe里分配的内存,在DLL里删除的问题
      

  3.   

    dll导出分配内存和释放内存的函数
      

  4.   

    多谢各位!我已经全部设为release版本, 直接执行程序, 但是程序提示:遇到问题需要关闭。我们对此引起的不便表示抱歉。to oyljerry, goodboyws:
    以前程序没有在修改之前一直没有问题, 程序新添加的东东没有新的分配内存和释放内存函数
      

  5.   

    thanks!我直接调试DLL, 在DEBUG模式下, 竟然提示:Unhandled exception In err.exe(NTDLL.DLL): 0XC0000005: Access Violation.继续调试, 
    继续提示:
    The thread 0X794 has exited with code -1073741819 (0xC0000005)
      

  6.   

    以前的接口是:
    int WINAPI PTSIT(char* pr1, char* pr2, char* pr3
        char* pr4, char* pr5, BYTE bt1, char* pr5,
        char* pr6, BYTE bt2, BYTE bt3, BYTE bt4, char* pr7,
        char* pr8, BYTE bt5, BYTE bt6, BYTE bt7, BYTE bt8, 
        BYTE bt9, BYTE* bt10,BYTE* bt11, BYTE* bt12);现在改为:
    int WINAPI PTSIT(char* pr1, char* pr2, char* pr3
        char* pr4, char* pr5, BYTE bt1, char* pr5,
        char* pr6, BYTE bt2, BYTE bt3, BYTE bt4, char* pr7,
        char* pr8, BYTE bt5, BYTE bt6, BYTE bt7, BYTE bt8, 
        BYTE bt9, BYTE* bt10,BYTE* bt11, BYTE* bt12, char* pt);只在最后面加上一个参数char* pt, pt字符串最长八个字符.
      

  7.   

    thanks!我直接调试DLL, 在DEBUG模式下, 竟然提示:First-chance exception in err.exe (err.DLL): 0xC0000005: Access Violation.
    First-chance exception in err.exe (NTDLL.DLL): 0xC0000005: Access Violation.
    The program 'D:\err\Release\err.exe' has exited with code 0 (0x0).其它程序也没有改什么地方呀!