1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Create window

Discussion in 'MFC' started by e_pech, Jul 25, 2008.

  1. e_pech

    e_pech New Member

    Joined:
    Jul 25, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hello! I'm kind of new using MFC. I have a Doc/View App (SDI) and I want to (thru a menu) create a new view of the document on a separate window (not like an MDI). How can I do that?
    Hope you can help me!
     
  2. e_pech

    e_pech New Member

    Joined:
    Jul 25, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hey! Reading a little bit about it on the internet, I came across this code.

    CMainFrame* pFrame = new CMainFrame;
    CCreateContext contexto;
    contexto.m_pCurrentDoc = this;
    contexto.m_pCurrentFrame = pFrame;
    contexto.m_pLastView = NULL;
    contexto.m_pNewDocTemplate = NULL;
    contexto.m_pNewViewClass =RUNTIME_CLASS(CFuncionesView);
    pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, &contexto); //AfxGetMainWnd()->GetActiveWindow(),
    pFrame->ShowWindow(SW_NORMAL);
     

Share This Page