Click here to Skip to main content
15,917,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Check if file existe, get temporary file name? Pin
TPN13-May-03 21:13
TPN13-May-03 21:13 
AnswerRe: Check if file existe, get temporary file name? Pin
David Crow14-May-03 3:30
David Crow14-May-03 3:30 
AnswerRe: Check if file existe, get temporary file name? Pin
lob14-May-03 3:35
lob14-May-03 3:35 
GeneralBrowse remote directory Pin
chaiyan13-May-03 17:38
chaiyan13-May-03 17:38 
Generalthread launcher Pin
aguest13-May-03 17:09
aguest13-May-03 17:09 
Generaledit control properties Pin
emrosa13-May-03 14:47
emrosa13-May-03 14:47 
GeneralRe: edit control properties Pin
valikac13-May-03 15:52
valikac13-May-03 15:52 
GeneralMDI Splitter Window crashes Pin
User 665813-May-03 12:34
User 665813-May-03 12:34 
Hi
I created an MDI application and divided the document into 2 rows, whereby the upper row is divided again into 2 colums (similiar to the irc-client mIRC).
The second row is of type CEditView, the right column of type CListView. That's how I created the splitter windows:
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
	CRect cr; 
	GetClientRect(&cr);

	if(!m_mainSplitter.CreateStatic(this, 2, 1)) 
	{ 
		MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR); 
		return FALSE; 
	}

	if(!m_mainSplitter.CreateView(1, 0, RUNTIME_CLASS(CEditView), CSize(cr.Width(), cr.Height()-iEditHeight), pContext)) 
	{ 
		MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR);
		return FALSE; 
	}

	if(!m_secSplitter.CreateStatic(&m_mainSplitter, 1,2,WS_CHILD | WS_VISIBLE | WS_BORDER, m_mainSplitter.IdFromRowCol(0, 0)))
	{ 
		MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR); 
		return FALSE; 
	}

/// OUTPUT
	if(!m_secSplitter.CreateView(0, 0, RUNTIME_CLASS(CFoxIRCView), CSize(cr.Width()-150, cr.Height()-iEditHeight), pContext)) 
	{ 
		MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR);
		return FALSE; 
	}

/// NICKLISTE
	if(!m_secSplitter.CreateView(0, 1, RUNTIME_CLASS(CListView), CSize(150, cr.Height()-iEditHeight), pContext)) 
	{ 
		MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR);
		return FALSE; 
	}

	m_mainSplitter.SetRowInfo(0, cr.Height()-iEditHeight, 0);
	m_secSplitter.SetColumnInfo(0,cr.Width()-iListWidth,0);
	m_secSplitter.SetColumnInfo(1,iListWidth,0);

	m_pOutputView	= (CFoxIRCView*)m_secSplitter.GetPane(0,0);
	m_pNicklistView = (CListView*)m_secSplitter.GetPane(0,1);
	m_pCommandView	= (CEditView*)m_mainSplitter.GetPane(1,0);

	CRichEditCtrl&	m_ctlOutput   = m_pOutputView->GetRichEditCtrl();
	CListCtrl&		m_ctlNicklist = m_pNicklistView->GetListCtrl();
	CEdit&			m_ctlCommand  = m_pCommandView->GetEditCtrl();

...
}


But whenever I hit Ctrl+X/C/V inside the EditView or the ListView my app crashes in viewrich.cpp in line 1870:
COleClientItem* CRichEditDoc::GetPrimarySelectedItem(CView* pView)
{
	ASSERT(pView->IsKindOf(RUNTIME_CLASS(CRichEditView)));
	return ((CRichEditView*)pView)->GetSelectedItem();
}


Where's the error?

Thanks in advance
Greg

modified 12-Sep-18 21:01pm.

GeneralRe: MDI Splitter Window crashes Pin
Anonymous13-May-03 15:54
Anonymous13-May-03 15:54 
GeneralRe: MDI Splitter Window crashes Pin
Anonymous13-May-03 17:46
Anonymous13-May-03 17:46 
GeneralRe: MDI Splitter Window crashes Pin
Anonymous13-May-03 17:55
Anonymous13-May-03 17:55 
GeneralRe: MDI Splitter Window crashes Pin
User 665814-May-03 0:32
User 665814-May-03 0:32 
GeneralVisual Studio Pointer Help.. Pin
keb13-May-03 11:58
keb13-May-03 11:58 
GeneralRe: Visual Studio Pointer Help.. Pin
Michael Pauli13-May-03 12:27
Michael Pauli13-May-03 12:27 
GeneralRe: Visual Studio Pointer Help.. Pin
Dean Goodman13-May-03 12:46
Dean Goodman13-May-03 12:46 
GeneralRe: Visual Studio Pointer Help.. Pin
David Crow14-May-03 3:35
David Crow14-May-03 3:35 
GeneralRe: Visual Studio Pointer Help.. Pin
keb13-May-03 13:03
keb13-May-03 13:03 
GeneralRe: Visual Studio Pointer Help.. Pin
John R. Shaw13-May-03 12:42
John R. Shaw13-May-03 12:42 
Generalmodeless Dlg Pin
MemLeak13-May-03 9:36
MemLeak13-May-03 9:36 
GeneralRe: modeless Dlg Pin
Anonymous13-May-03 10:26
Anonymous13-May-03 10:26 
GeneralRe: modeless Dlg Pin
MAAK13-May-03 21:25
MAAK13-May-03 21:25 
GeneralRe: modeless Dlg Pin
MAAK13-May-03 21:32
MAAK13-May-03 21:32 
GeneralRe: modeless Dlg Pin
Neville Franks13-May-03 23:28
Neville Franks13-May-03 23:28 
GeneralRegion Pin
MemLeak13-May-03 8:12
MemLeak13-May-03 8:12 
GeneralRe: Region Pin
rochmad13-May-03 8:31
rochmad13-May-03 8:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.