Re: EnumChildWindows
"Al" <Al@discussions.microsoft.com> wrote in message
news:48A52D5E-8F1F-4020-83C7-43D5643617C0@microsoft.com...
Well the program stops and has a Debug Assertion Failed.
File:f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\winsplit.cpp
line 341
To get to this I have a function OnChoose in the MainFrm Class which
selects
the the correct RUNTIMECLASS to send to ReplaceView function in
CMySplitterWnd class derived from CSplitterWnd. I have a CMySplitterWnd *
variable m_pWndSplitter in MainFrame class. So once a selection is made
<code>
m_pWndSplitter->ReplaceView(0,1,RUNTIME_CLASS(CRHSplitEstab),CSize(100,100));
<code>
is executed and then
<code>
bool CMySplitterWnd::ReplaceView(int row, int col,CRuntimeClass *
pViewClass,SIZE size)
{
CCreateContext context;
BOOL bSetActive;
<error>
if ((GetPane(row,col)->IsKindOf(pViewClass))==TRUE)
return FALSE;
<error>
I step into this function while running the program and it comes to this
function in Visual Studios code in class winsplit.cpp, at which time it
cause
the error.
<code>
CWnd* CSplitterWnd::GetPane(int row, int col) const
{
ASSERT_VALID(this);
I don't know why it is not getting the "this"
--
Just Al
It is saying that the m_pWndSplitter that you started with is not pointing
at a valid splitter window. It seems very strange that you would have a
pointer variable for this. Normally you would have a m_MySplitterWnd
variable in the mainframe. So why do you have a pointer, and why is it
apparently not pointing at the CMySplitterWnd object that you created
originally?
--
Scott McPhillips [VC++ MVP]