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

C / C++ / MFC

 
GeneralRe: RecordCount in Ado RecordSet Pin
J. Dunlap7-Apr-03 7:54
J. Dunlap7-Apr-03 7:54 
GeneralRe: loading a dll to the runtime... Pin
Cedric Moonen7-Apr-03 3:57
Cedric Moonen7-Apr-03 3:57 
GeneralRe: loading a dll to the runtime... Pin
Le centriste7-Apr-03 4:22
Le centriste7-Apr-03 4:22 
GeneralRe: loading a dll to the runtime... Pin
Le centriste7-Apr-03 4:37
Le centriste7-Apr-03 4:37 
GeneralRe: loading a dll to the runtime... Pin
Le centriste7-Apr-03 4:50
Le centriste7-Apr-03 4:50 
GeneralRe: loading a dll to the runtime... Pin
Le centriste7-Apr-03 4:58
Le centriste7-Apr-03 4:58 
GeneralRe: loading a dll to the runtime... Pin
Le centriste7-Apr-03 5:25
Le centriste7-Apr-03 5:25 
Generalrepost this article! Pin
zhangyifei7-Apr-03 3:26
zhangyifei7-Apr-03 3:26 
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));
// pDocTemplate in destructor function delete this!

CMapDoc * pDoc = new CMapDoc;// in destructor function delete this!

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;// in destructor function delete this!

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
General"The instruction at [xxx] referenced memory at [xxx]"... Pin
dandy727-Apr-03 3:17
dandy727-Apr-03 3:17 
GeneralRe: "The instruction at [xxx] referenced memory at [xxx]"... Pin
Chris Richardson7-Apr-03 3:26
Chris Richardson7-Apr-03 3:26 
GeneralRe: "The instruction at [xxx] referenced memory at [xxx]"... Pin
dandy727-Apr-03 5:25
dandy727-Apr-03 5:25 
Generalnon static member Pin
summo7-Apr-03 3:03
summo7-Apr-03 3:03 
GeneralRe: non static member Pin
Chris Losinger7-Apr-03 3:06
professionalChris Losinger7-Apr-03 3:06 
QuestionSeperator in dialog ? Pin
Brian van der Beek7-Apr-03 2:59
Brian van der Beek7-Apr-03 2:59 
AnswerRe: Seperator in dialog ? Pin
Chris Losinger7-Apr-03 3:08
professionalChris Losinger7-Apr-03 3:08 
GeneralRe: Seperator in dialog ? Pin
Brian van der Beek7-Apr-03 3:22
Brian van der Beek7-Apr-03 3:22 
GeneralRe: Seperator in dialog ? Pin
Brian van der Beek7-Apr-03 3:22
Brian van der Beek7-Apr-03 3:22 
GeneralRe: Seperator in dialog ? Pin
puzzolino7-Apr-03 3:32
puzzolino7-Apr-03 3:32 
GeneralRe: Seperator in dialog ? Pin
Chris Losinger7-Apr-03 3:57
professionalChris Losinger7-Apr-03 3:57 
GeneralRe: Seperator in dialog ? Pin
puzzolino7-Apr-03 4:05
puzzolino7-Apr-03 4:05 
GeneralUsing MScomm32.ocx with Visual Studio.Net Pin
Vassili7-Apr-03 2:19
Vassili7-Apr-03 2:19 
Generaldefault browser Pin
Jump_Around7-Apr-03 0:42
Jump_Around7-Apr-03 0:42 
GeneralRe: default browser Pin
Dominik Reichl7-Apr-03 1:00
Dominik Reichl7-Apr-03 1:00 
GeneralRe: default browser Pin
Rage7-Apr-03 1:09
professionalRage7-Apr-03 1:09 
GeneralRe: default browser Pin
Anonymous7-Apr-03 9:27
Anonymous7-Apr-03 9:27 

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.