[vtkusers] *The solution* Re: Access violations in MFC sample
Joao Filipe de Castro Ferreira
jfilipe at isr.uc.pt
Mon Dec 10 15:23:17 EST 2001
Dear Andrew,
I regret to tell you that I used that exact version (which only corrects
the interactor problem), but the problem remained. The question is, if you
don't pay attention to your VC++ debugger (not so unusual a thing to
happen ;)) ), you will miss those access violations and the program will
*seem* too work without a problem.
I have, thus, decided to collect my MFC wits and put them to use to solve
the problem, which I have noticed by thumbling through the list's archives
to be a recurring one, and, voila!, have solved it thus:
The OnCreate override is not the correct place to get
the m_hWnd handle from the *not yet visible* window for the RenderWindow
member. The *correct* procedure is to move the respective line from the
OnCreate override to a newly overriden OnInitialUpdate member, without
forgetting to *call the base class member first*. That's it, really!
If anybody still has any doubt on this subject, please write and I will
submit code snippets from my own modified MFCSample.
Cheers,
JFC
From: a.maclean at acfr.usyd.edu.au
> Get the most recent version of Sample from a nightly download. I have no
troubles with it.
More information about the vtkusers
mailing list