no view in my mfc |
Post Reply |
Author | |
jjqin
Newbie Joined: 18 October 2007 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 12 January 2009 at 12:52pm |
Hi support,
In my project which is mfc but linked codejock as static lib and in my project which do not have view class and every thing it doing in the child frame class. I had a lot crush cause by dc.m_hDC = NULL. Any idea to fix this quickly?
Thanks in the advance.
-JianJing
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Child frame should have some internal content - usually created in virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
Do you have one?
e.g. in my sample used new MS FeaturePack I use it this way as like to have calendar and datepiker in one child frame but you can eliminate splitter and create only calendar control here BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{ BOOL bRet = TRUE;//CMDIChildWndEx::OnCreateClient(lpcs, pContext); if (!m_wndSplitter.CreateStatic(this, 1, 2))
{ TRACE0("Failed to create split bar "); return FALSE; } VERIFY(m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CCalViewNew),CSize(200, 200),pContext));
VERIFY(m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CDatePickerView),CSize(200, 200),pContext)); bReady = TRUE;
CMainFrame* pMain = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd()); if (pMain) { CCalViewNew* pCal = DYNAMIC_DOWNCAST(CCalViewNew, m_wndSplitter.GetPane(0,0)); if (pCal) pCal->m_CalendarController.SetDatePicker(pMain->m_Picker); } return bRet;
} Another approach - create calendar in dialog - there is sample how to implement it (look in Forum - there is a link to my recent source)
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |