Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CMDIChildWnd size problem in DOC/View OCX

CMDIChildWnd size problem in DOC/View OCX

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpcomquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    G Richard
    wrote on last edited by
    #1

    I want to migrate a MFC doc/view application to an activex control. I create the CMainFrame(inherited from CMDIFrameWnd) object when the activeX control is Created. but when i open a document, access violation occured in user.dll and no source code. i found the error is from CMDIChildFrame::OnSize. the following is my code : BOOL CMultiDocOCXCtrl::CreateMDIFrame() { if(m_pFrameWnd != NULL) return FALSE; CRect rc; GetClientRect(&rc); CMultiDocTemplate* pDocTemplate = new CMultiDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMyDocument), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CMyView)); AfxGetApp()->AddDocTemplate(pDocTemplate); // CString sClassName = AfxRegisterWndClass(CS_DBLCLKS); CMainFrame * pFrame = new CMainFrame; if(!pFrame->Create(sClassName, NULL, WS_CHILD|WS_VISIBLE, rc, this, MAKEINTRESOURCE(IDR_MAINFRAME), 0, NULL)) { delete pFrame; return FALSE; } pFrame->ShowWindow(SW_SHOW); pFrame->RecalcLayout(); // m_pFrameWnd = pFrame; // AfxGetApp()->m_pMainWnd = m_pFrameWnd; theApp.OnNewFile(); // return TRUE; } Is anybody know how this problem occur? c++ : my dream

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups