BLOCK_TYPE_IS_VALID

Hi guys,
I have a lib maked by VS6 and it's used by another application in C++ managed.
Sometimes I got a BLOCK_TYPE_IS_VALID assert.
Does anybody say me why
Thank you


Answer this question

BLOCK_TYPE_IS_VALID

  • comsolver

    You destroyed your heap. So a memory block is overwritten. I.e. you allocated 100 bytes but you copyied 101 bytes into it.

    You can use _heapchk to get close to the point were the error has its source.

    You can use _CrtSetDbgFlag with CRTDBG_CHECK and _ALWAYS_DF too.



  • Kjeld Tommeraas

    Martin Richter wrote:

    You can use _heapchk to get close to the point were the error has its source.

    You can use _CrtSetDbgFlag with CRTDBG_CHECK and _ALWAYS_DF too.

    What kind of option are

    Compiler options or what

    tnx


  • allenmpcx

    _CrtSetDbgFlag is a CRT function.

    RTFM = Read the fine MSDN!

    http://msdn.microsoft.com/library/en-us/vclib/html/_CRT__CrtSetDbgFlag.asp frame=true



  • saurabhdotnet

    I did change whole my code in order to don't use the heap memory.
    Now I receive the following error (they are frequently recurring events):

    _CrtIsValidHeapPointer

    Why


  • APMadsen

    You rae still destroying the heap!

    Even if you don't use the heap. The CRT will use the heap, or other components will!



  • Mkely

    Yes, I did RTFM just after the post. :)

    Tnx for the help


  • BLOCK_TYPE_IS_VALID