[vtkusers] vtkMFCWindow: new and delete problems
echinococcus Multilocularis
lintworm2 at yahoo.co.uk
Sun Oct 15 18:37:26 EDT 2006
Thank you for your response on this. However, the approach you suggest, that's exactly what i have done. In fact it also happens when i place both the new and the delete command directly after eachother, the same thing happens... I might try a rebuild...
Thanks anyway
----- Original Message ----
From: John Platt <jcplatt at dsl.pipex.com>
To: echinococcus Multilocularis <lintworm2 at yahoo.co.uk>
Cc: vtkusers at vtk.org
Sent: Monday, 16 October, 2006 12:27:05 AM
Subject: RE: [vtkusers] vtkMFCWindow: new and delete problems
<!--
_filtered {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
_filtered {
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
_filtered {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.emailstyle17
{font-family:Arial;
color:navy;}
span.EmailStyle18
{font-family:Arial;
color:navy;}
_filtered {
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{}
-->
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
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
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/f099146f/attachment.htm>
More information about the vtkusers
mailing list