[vtkusers] RE:Comment on: *The solution* Re: Access violations in MFC sample

Sebastien BARRE sebastien.barre at kitware.com
Tue Dec 11 17:37:53 EST 2001


At 12/12/2001 09:22 AM, Andrew J. P. Maclean wrote:
>This is strange. In int vtkMFCRenderView::OnCreate(LPCREATESTRUCT
>lpCreateStruct)
>I have:
>{
>   if (vtkMFCView::OnCreate(lpCreateStruct) == -1)
>     return -1;
>
>   // TODO: Add your specialized creation code here
>   this->RenderWindow->SetParentId(lpCreateStruct->hwndParent);
>   this->RenderWindow->SetWindowId(this->m_hWnd);
>   this->RenderWindow->WindowInitialize();
>   return 0;
>}
>
>The key is to call vtkMFCView::OnCreate(...) before setting the
>Parent/Window ID and then initializing.

I do not see any difference between this code and the current CVS code.

>As I said, I have no access violations at all with the above paradigm.
>After checking with the debugger, everything seems to be initialized and
>allocated correctly.

Build -> Start Debug -> Go
then exit the example

Look at the debug win:
Detected memory leaks!
Dumping objects ->
{713} normal block at 0x07291BC8, 15 bytes long.
  Data: <vtkOpenGLLight > 76 74 6B 4F 70 65 6E 47 4C 4C 69 67 68 74 00
{712} normal block at 0x07291888, 12 bytes long.


--
Sebastien Barre




More information about the vtkusers mailing list