CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jul 2005
    Posts
    2

    Angry Debug Assertion Failed

    Hi,
    I´m working in a project that uses 3 dlls:
    AutoLib.dll
    CommLib.dll
    GDCP.dll
    and an .EXE.
    MbConfigurator.
    that uses those DLLs implictly linked.

    It all compiled and linked fine, but when its running in Debug version, i´m getting this a "debug assertion failed!" when I call:

    Code:
    func1(){
    ...
    TArrayStream* channelNames;   //TArrayStream is a class defined inside autolib.dll
    channelNames=mapChannels->ReturnChannelsNames(); //mapchannel is an instance of a class defined inside GDCP.dll
    delete channelNames; //when it try to destroy this object
    ...
    }
    i´m getting:
    Debug Assertion Failed!
    File: dbgheap.c
    Line: 1132
    Expression: _CrtIsValidHeapPointer(pUserData)

    the code of ReturnChannelNames:
    Code:
    TArrayStream* TMapChannels::ReturnChannelsNames(void){
      size_t i, qtd;
      qtd=channels->GetElQty();
      TArrayStream* vector;
      if(qtd>0){         
        TChannelDevices* pChanEncontrado;
        vector=new TArrayStream(MAX_CHANNEL_NAME,qtd);
        for(i=1;i<=qtd;i++){      
          char buffer[MAX_CHANNEL_NAME];  
          channels->Get(i,&pChanEncontrado);
          pChanEncontrado->ReturnChannelName(buffer);
          vector->Add(buffer);         
        }
        return(vector);
      }  
      return(NULL);    
     }
    I´ve researched, and I´ve founded out that I must run all the project using the same DLL. I´ve made it all the same but the problem won´t go away. Is there any body than can help me?
    Thanks,
    Adrian
    Last edited by cilu; November 22nd, 2005 at 03:50 PM. Reason: added code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured