[vtkusers] vtkMFCWindow: new and delete problems

echinococcus Multilocularis lintworm2 at yahoo.co.uk
Sun Oct 15 11:09:03 EDT 2006


Hello,

I have restarted working with vtk, this time under windows, M$ VC++ 6.0. I have vtk 5.0.2 installed, built in the release with symbols mode, on a windows 2000 machine. I want to use the MFC functionalities, and thus i looked into the examples on MFC. I have started my own project and use the example to find the nesecary steps.

So far so good. However, when want to create a vtkMFCWindow in debug-mode, and delete it later on, so like this:

    m_pMFCWindow = new vtkMFCWindow(this->GetDlgItem(DISPLAYFRAME));
    delete m_pMFCWindow;

I get a dialog telling me that a debug assertion failed. specifically it tells me that it stops on:
    pHead->nBlockUsed == nBlockUsed

Furthermore i get a warning:
    Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called.

Again, all of this is only in debug mode. I know that i link the vtk library in release mode w/ symbols on my program, can that be the problem? When i run my program in Release mode, obviously i don't get the debug assertion failed dialog. 

How do you create and destroy an object of the type vtkMFCWindow in a correct way?

TIA!

Han



Send instant messages to your online friends http://uk.messenger.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061015/15bc8c05/attachment.htm>


More information about the vtkusers mailing list