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. Why no one can resolvoe this Question?Doc/view/frame!

Why no one can resolvoe this Question?Doc/view/frame!

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomperformance
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.
  • Z Offline
    Z Offline
    zhangyifei
    wrote on last edited by
    #1

    I want to Create a Frame/view/doc structure On a ActiveX Control,but It will be Found Memory leak! And I Found that the reasons is : CDocManager* CDocManager::pStaticDocManager; CPtrList* CDocManager::pStaticList; How Can I avoid Memroy leak? the Following is My Code : BOOL Create() { if( m_pFrameWnd ) { if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE; } CSingleDocTemplate * pDocTemplate; pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE, RUNTIME_CLASS(CMapDoc), RUNTIME_CLASS(CMapFrame), RUNTIME_CLASS(CMapView)); CMapDoc * pDoc = new CMapDoc; CCreateContext Context; Context.m_pCurrentDoc = pDoc; Context.m_pNewDocTemplate = pDocTemplate; Context.m_pNewViewClass = RUNTIME_CLASS(CMapView); Context.m_pLastView = NULL; Context.m_pCurrentFrame = NULL; CMapFrame * pFrameWnd = new CMapFrame; m_pDoc = pDoc; m_pFrameWnd = pFrameWnd; m_pDocTemplate = pDocTemplate; CRect rcMap; GetClientRect(&rcMap); BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context); m_pFrameWnd->ShowWindow(SW_SHOW); return ret; } ZHANGYIFEI ZHANGYIFEI

    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