[vtkusers] vtkMFCWindow: new and delete problems
John Platt
jcplatt at dsl.pipex.com
Sun Oct 15 18:27:05 EDT 2006
Try creating a new window in OnInitDialog() and delete in ON_WM_DESTROY
handler. You could also look at the example
Examples\GUI\Win32\vtkMFC\vtkDLG.
HTH
John.
-----Original Message-----
From: echinococcus Multilocularis [mailto:lintworm2 at yahoo.co.uk]
Sent: 15 October 2006 21:00
To: John Platt
Subject: Re: [vtkusers] vtkMFCWindow: new and delete problems
I am building a dialog based program, and not using SDI, nor MDI.
Thank you for your response.
Sincerely,
Han
----- Original Message ----
From: John Platt <jcplatt at dsl.pipex.com>
To: echinococcus Multilocularis <lintworm2 at yahoo.co.uk>
Sent: Sunday, 15 October, 2006 9:31:13 PM
Subject: RE: [vtkusers] vtkMFCWindow: new and delete problems
If you are using the document view architecture, you would normally let
the document create the view through an appropriate document template.
SDI & MDI projects will do this automatically for you. If you look at a
typical CView derived class you will see that the constructor is
protected preventing the kind of operation you are attempting.
HTH
John.
-----Original Message-----
From: vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org
[mailto:vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org] On Behalf Of
echinococcus Multilocularis
Sent: 15 October 2006 16:15
To: vtkusers at vtk.org
Subject: [vtkusers] vtkMFCWindow: new and delete problems
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
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/d9cebf79/attachment.htm>
More information about the vtkusers
mailing list