Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalmany thanks Pin
ns2-Apr-03 5:25
ns2-Apr-03 5:25 
GeneralRe: shift key and button click Pin
De Nardis Andrea2-Apr-03 5:12
De Nardis Andrea2-Apr-03 5:12 
GeneralRe: shift key and button click Pin
peterchen2-Apr-03 6:07
peterchen2-Apr-03 6:07 
Generalsend winpcap packet Pin
summo2-Apr-03 3:40
summo2-Apr-03 3:40 
GeneralDestroying ActiveX Pin
Cedric Moonen2-Apr-03 3:03
Cedric Moonen2-Apr-03 3:03 
GeneralRe: Destroying ActiveX Pin
peterchen2-Apr-03 6:10
peterchen2-Apr-03 6:10 
GeneralRe: Destroying ActiveX Pin
Cedric Moonen2-Apr-03 19:01
Cedric Moonen2-Apr-03 19:01 
GeneralA Frame/view/doc question! Pin
zhangyifei2-Apr-03 3:03
zhangyifei2-Apr-03 3:03 
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
GeneralRe: A Frame/view/doc question! Pin
John R. Shaw2-Apr-03 10:24
John R. Shaw2-Apr-03 10:24 
GeneralRe: A Frame/view/doc question! Pin
zhangyifei3-Apr-03 2:17
zhangyifei3-Apr-03 2:17 
GeneralRe: A Frame/view/doc question! Pin
John R. Shaw3-Apr-03 6:58
John R. Shaw3-Apr-03 6:58 
Generalcheck the cd-rom tray Pin
particle2k2-Apr-03 2:34
particle2k2-Apr-03 2:34 
GeneralList & Hash Table implemetations Pin
Makover2-Apr-03 0:54
Makover2-Apr-03 0:54 
GeneralRe: List & Hash Table implemetations Pin
jhwurmbach2-Apr-03 1:16
jhwurmbach2-Apr-03 1:16 
GeneralRe: List & Hash Table implemetations Pin
Makover2-Apr-03 8:33
Makover2-Apr-03 8:33 
GeneralRe: List & Hash Table implemetations Pin
jhwurmbach2-Apr-03 20:58
jhwurmbach2-Apr-03 20:58 
GeneralRe: List & Hash Table implemetations Pin
Makover2-Apr-03 21:10
Makover2-Apr-03 21:10 
QuestionWM_ACTIVATEAPP: Windows bug with taskbar? Pin
Vasiliy Zverev2-Apr-03 0:52
Vasiliy Zverev2-Apr-03 0:52 
GeneralGetting file-path through an activex...please help me Pin
ZarrinPour2-Apr-03 0:52
ZarrinPour2-Apr-03 0:52 
QuestionHow to load a .jpg picture? Pin
stanley guan2-Apr-03 0:35
stanley guan2-Apr-03 0:35 
AnswerRe: How to load a .jpg picture? Pin
Vasiliy Zverev2-Apr-03 0:49
Vasiliy Zverev2-Apr-03 0:49 
AnswerRe: How to load a .jpg picture? Pin
Chintan2-Apr-03 7:04
Chintan2-Apr-03 7:04 
GeneralPassing CString objs to an MFC extension DLL Pin
Abin2-Apr-03 0:28
Abin2-Apr-03 0:28 
GeneralRe: Passing CString objs to an MFC extension DLL Pin
Roger Allen2-Apr-03 1:04
Roger Allen2-Apr-03 1:04 
GeneralRe: Passing CString objs to an MFC extension DLL Pin
Abin2-Apr-03 3:22
Abin2-Apr-03 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.