Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC
  New Posts New Posts RSS Feed - no view in my mfc
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum Lockedno view in my mfc

 Post Reply Post Reply
Author
Message
jjqin View Drop Down
Newbie
Newbie


Joined: 18 October 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjqin Quote  Post ReplyReply Direct Link To This Post Topic: no view in my mfc
    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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2009 at 11:00pm
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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.