BOOL CAutoSlow1Dlg::GetRecStore(CMapWordToPtr* pList)
{
pSlowSet = new CAutoSlowSet;
if(pSlowSet == NULL)
return FALSE;
pSlowSet->m_pDatabase = pDatabase;
pSlowSet->m_strSort = "pro_index DESC";
if(!pSlowSet->Open(CRecordset::snapshot))
{
pSlowSet->Close();
delete pSlowSet;
return FALSE;
}
if(pSlowSet->IsEOF() && pSlowSet->IsBOF())
{
pSlowSet->Close();
delete pSlowSet;
return TRUE;
}
while(!pSlowSet->IsEOF())
{
STOREBASE* pObj = new STOREBASE;
CTime t=CTime::GetCurrentTime();
pObj->nIndex = pSlowSet->m_pro_index;
pObj->strTheme = pSlowSet->m_theme;
pObj->strFileName = pSlowSet->m_pathname;
pObj->strTheme.TrimRight();
pObj->strTheme.TrimLeft();
pObj->strFileName.TrimRight();
pObj->strFileName.TrimLeft();
pObj->nTdh=pSlowSet->m_td;
pObj->isDel=pSlowSet->m_isdel;
pObj->tdhMs=pSlowSet->m_tdms;
//时间转换
char sHour[5],sMin[5],sSec[5],eHour[5],eMin[5],eSec[5];
sprintf(sHour,pSlowSet->m_starttime.Left(2));
sprintf(sMin,pSlowSet->m_starttime.Left(5).Right(2));
sprintf(sSec,pSlowSet->m_starttime.Right(2));
sprintf(eHour,pSlowSet->m_endtime.Left(2));
sprintf(eMin,pSlowSet->m_endtime.Left(5).Right(2));
sprintf(eSec,pSlowSet->m_endtime.Right(2));
CTime sTime(t.GetYear(),t.GetMonth(),t.GetDay(),atoi(sHour),atoi(sMin),atoi(sSec));
CTime eTime(t.GetYear(),t.GetMonth(),t.GetDay(),atoi(eHour),atoi(eMin),atoi(eSec));
pObj->StartTime=sTime; //starttime
pObj->EndTime=eTime; //endtime
pList->SetAt((unsigned short)pObj->nIndex,pObj);
pSlowSet->MoveNext();
}
pSlowSet->Close();
delete pSlowSet;
//delete pObj111;
return TRUE;
}
但调试程序始终说我STOREBASE* pObj = new STOREBASE;这句语句内存泄漏,不知如何处理,请教各位大师,请详细一点,因为小弟才刚入门,谢谢!
29 个解决方案
#1
怎么没有人呢????????
#2
你在哪儿 delete(pObj); 了呢?
#3
我没有delete(pObj);因为一delete就非法操作
#4
那你能告诉我在那里delete
#5
当你不再使用那个pList时,需要将其中的所有东西都给删除掉的!
这样就应该不会内存泄漏了!
这样就应该不会内存泄漏了!
#6
老问题了。
你的这个List只是STOREBASE指针的List,也就是说只记录了一个32bit的值。
List不可能去释放它。
解决方案:CMapWordToPtr析构前,遍历每个节点,delete它。
给分吧!!!!!!!!!!!!!!!!!!!
你的这个List只是STOREBASE指针的List,也就是说只记录了一个32bit的值。
List不可能去释放它。
解决方案:CMapWordToPtr析构前,遍历每个节点,delete它。
给分吧!!!!!!!!!!!!!!!!!!!
#7
怎样遍历每个节点呢?请详细一点,我很笨,但我一定给分
#8
发表个人看法:
pSlowSet = new CAutoSlowSet;
if(pSlowSet == NULL)
return FALSE;
我估计在if后面的条件恒为TRUE,直接执行 m_pSet.Open()会好一点,但怎么就调试过去了呢?
STOREBASE* pObj = new STOREBASE;
pObj可能也是指向数据库的指针,好象没有Open过。应该有问题。
至于内存泄露,这是肯定的,你每做一个循环就new一个,而且没有好好初始化,你的机器估计内存比较大.
pObj是局部变量,在while右括号处,他的生命已经结束了,你在while循环外delete一个不存在的变量,肯定出事。
pSlowSet = new CAutoSlowSet;
if(pSlowSet == NULL)
return FALSE;
我估计在if后面的条件恒为TRUE,直接执行 m_pSet.Open()会好一点,但怎么就调试过去了呢?
STOREBASE* pObj = new STOREBASE;
pObj可能也是指向数据库的指针,好象没有Open过。应该有问题。
至于内存泄露,这是肯定的,你每做一个循环就new一个,而且没有好好初始化,你的机器估计内存比较大.
pObj是局部变量,在while右括号处,他的生命已经结束了,你在while循环外delete一个不存在的变量,肯定出事。
#9
CMapWordToPtr wtPtr;
CString key;
CObject* pObj;
POSITION pos;
for( pos = wtPtr.GetStartPosition(); pos != NULL; )
{
wtPtr.GetNextAssoc( pos, key, (CObject*&)pObj);
delete pObj;
}
CString key;
CObject* pObj;
POSITION pos;
for( pos = wtPtr.GetStartPosition(); pos != NULL; )
{
wtPtr.GetNextAssoc( pos, key, (CObject*&)pObj);
delete pObj;
}
#10
我在析构里写了:
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
但还是内存泄漏,不知为何?
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
但还是内存泄漏,不知为何?
#11
你跟过没有?
很没道理,你写有问题。
先把分给了吧!
很没道理,你写有问题。
先把分给了吧!
#12
delete无效指针是要出保护错的!!!!!
#13
我debug了,但output还是:
strcore.cpp(76) : {554} normal block at 0x007A78B0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {553} normal block at 0x007A7860, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {552} normal block at 0x007A7FB0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {551} normal block at 0x007A7E30, 36 bytes long.
Data: < z ; ;> 01 00 00 00 BC 7F 7A 00 E0 A7 1E 3B BC 9D 1F 3B
strcore.cpp(76) : {542} normal block at 0x007A7DB0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {541} normal block at 0x007A79F0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {540} normal block at 0x007A79B0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {539} normal block at 0x007A7960, 36 bytes long.
Data: < yz ; ;> 02 00 00 00 BC 79 7A 00 E0 A7 1E 3B F0 96 1F 3B
strcore.cpp(76) : {530} normal block at 0x007A7D70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {529} normal block at 0x007A7D20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {528} normal block at 0x007A7CE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {527} normal block at 0x007A7C90, 36 bytes long.
Data: < |z ; ;> 03 00 00 00 EC 7C 7A 00 E0 A7 1E 3B E0 88 1F 3B
strcore.cpp(76) : {518} normal block at 0x007A7F70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {517} normal block at 0x007A7F20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {516} normal block at 0x007A7EE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {515} normal block at 0x007A7E90, 36 bytes long.
Data: < ~z ; ;> 04 00 00 00 EC 7E 7A 00 D0 99 1E 3B E0 A7 1E 3B
strcore.cpp(76) : {506} normal block at 0x007A7C50, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {505} normal block at 0x007A7C00, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {504} normal block at 0x007A7BC0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {503} normal block at 0x007A7B70, 36 bytes long.
Data: < {z ; ;> 05 00 00 00 CC 7B 7A 00 E0 A7 1E 3B E8 8F 1F 3B
strcore.cpp(76) : {492} normal block at 0x007A7820, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {491} normal block at 0x007A77D0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {490} normal block at 0x007A7790, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {489} normal block at 0x007A7740, 36 bytes long.
Data: < wz ; ;> 06 00 00 00 9C 77 7A 00 D0 99 1E 3B E0 A7 1E 3B
why?????????????
strcore.cpp(76) : {554} normal block at 0x007A78B0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {553} normal block at 0x007A7860, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {552} normal block at 0x007A7FB0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {551} normal block at 0x007A7E30, 36 bytes long.
Data: < z ; ;> 01 00 00 00 BC 7F 7A 00 E0 A7 1E 3B BC 9D 1F 3B
strcore.cpp(76) : {542} normal block at 0x007A7DB0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {541} normal block at 0x007A79F0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {540} normal block at 0x007A79B0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {539} normal block at 0x007A7960, 36 bytes long.
Data: < yz ; ;> 02 00 00 00 BC 79 7A 00 E0 A7 1E 3B F0 96 1F 3B
strcore.cpp(76) : {530} normal block at 0x007A7D70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {529} normal block at 0x007A7D20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {528} normal block at 0x007A7CE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {527} normal block at 0x007A7C90, 36 bytes long.
Data: < |z ; ;> 03 00 00 00 EC 7C 7A 00 E0 A7 1E 3B E0 88 1F 3B
strcore.cpp(76) : {518} normal block at 0x007A7F70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {517} normal block at 0x007A7F20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {516} normal block at 0x007A7EE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {515} normal block at 0x007A7E90, 36 bytes long.
Data: < ~z ; ;> 04 00 00 00 EC 7E 7A 00 D0 99 1E 3B E0 A7 1E 3B
strcore.cpp(76) : {506} normal block at 0x007A7C50, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {505} normal block at 0x007A7C00, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {504} normal block at 0x007A7BC0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {503} normal block at 0x007A7B70, 36 bytes long.
Data: < {z ; ;> 05 00 00 00 CC 7B 7A 00 E0 A7 1E 3B E8 8F 1F 3B
strcore.cpp(76) : {492} normal block at 0x007A7820, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {491} normal block at 0x007A77D0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {490} normal block at 0x007A7790, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {489} normal block at 0x007A7740, 36 bytes long.
Data: < wz ; ;> 06 00 00 00 9C 77 7A 00 D0 99 1E 3B E0 A7 1E 3B
why?????????????
#14
能再帮我分析一下,分我会给的。
#15
跟过这儿没有?????
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
#16
尤其delete store;这一行。
#17
你等一下,我跟一下
#18
pSlowSet->m_pro_index有没有重复???
我个人认为:阁下编程习惯有问题。
我个人认为:阁下编程习惯有问题。
#19
跟的怎么样才算对呢?
#20
delete一个有效指针,
delete次数和new的次数一样。
delete次数和new的次数一样。
#21
delete和new是一样多的,是否我把代码没放在析构函数中,我放在OnDestory()
#22
sorry,OnDestroy()
#23
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264)
是哪行?
是哪行?
#24
与 SuperProgMan(编程者) 商量一下:
我认为这样会稍好一点。
STOREBASE* pObj = new STOREBASE;
pObj->Open();
while(!pSlowSet->IsEOF())
{
// ..................
}
pObj->Close();
delete pObj;
如果用try,catch,throw更好
我认为这样会稍好一点。
STOREBASE* pObj = new STOREBASE;
pObj->Open();
while(!pSlowSet->IsEOF())
{
// ..................
}
pObj->Close();
delete pObj;
如果用try,catch,throw更好
#25
STOREBASE的结构是什么样?
#26
to ahphone(《风云3》里头劫镖的:
有道理
有道理
#27
#ifndef _MYDEFINE_H_
#define _MYDEFINE_H_
typedef struct tagStore{
long nIndex; //索引
CString strTheme; //主题
CTime StartTime; //开始时间
CTime EndTime; //结束时间
CString strFileName; //文件路径
long nTdh; //通道号
CString tdhMs; //通道号描述
BOOL isDel; //是否删除
CString strweek;
//BOOL bDs; //是否定时
}STOREBASE;
#endif
#define _MYDEFINE_H_
typedef struct tagStore{
long nIndex; //索引
CString strTheme; //主题
CTime StartTime; //开始时间
CTime EndTime; //结束时间
CString strFileName; //文件路径
long nTdh; //通道号
CString tdhMs; //通道号描述
BOOL isDel; //是否删除
CString strweek;
//BOOL bDs; //是否定时
}STOREBASE;
#endif
#28
to jxxfy(许方勇):
ahphone(《风云3》里头劫镖的) 说法有道理!
ahphone(《风云3》里头劫镖的) 说法有道理!
#29
to jxxfy(许方勇):
对不起,我一直用STL,没用过CMapWordToPtr。
按《ahphone(《风云3》里头劫镖的)》的做应该没问题。
对不起,我一直用STL,没用过CMapWordToPtr。
按《ahphone(《风云3》里头劫镖的)》的做应该没问题。
#1
怎么没有人呢????????
#2
你在哪儿 delete(pObj); 了呢?
#3
我没有delete(pObj);因为一delete就非法操作
#4
那你能告诉我在那里delete
#5
当你不再使用那个pList时,需要将其中的所有东西都给删除掉的!
这样就应该不会内存泄漏了!
这样就应该不会内存泄漏了!
#6
老问题了。
你的这个List只是STOREBASE指针的List,也就是说只记录了一个32bit的值。
List不可能去释放它。
解决方案:CMapWordToPtr析构前,遍历每个节点,delete它。
给分吧!!!!!!!!!!!!!!!!!!!
你的这个List只是STOREBASE指针的List,也就是说只记录了一个32bit的值。
List不可能去释放它。
解决方案:CMapWordToPtr析构前,遍历每个节点,delete它。
给分吧!!!!!!!!!!!!!!!!!!!
#7
怎样遍历每个节点呢?请详细一点,我很笨,但我一定给分
#8
发表个人看法:
pSlowSet = new CAutoSlowSet;
if(pSlowSet == NULL)
return FALSE;
我估计在if后面的条件恒为TRUE,直接执行 m_pSet.Open()会好一点,但怎么就调试过去了呢?
STOREBASE* pObj = new STOREBASE;
pObj可能也是指向数据库的指针,好象没有Open过。应该有问题。
至于内存泄露,这是肯定的,你每做一个循环就new一个,而且没有好好初始化,你的机器估计内存比较大.
pObj是局部变量,在while右括号处,他的生命已经结束了,你在while循环外delete一个不存在的变量,肯定出事。
pSlowSet = new CAutoSlowSet;
if(pSlowSet == NULL)
return FALSE;
我估计在if后面的条件恒为TRUE,直接执行 m_pSet.Open()会好一点,但怎么就调试过去了呢?
STOREBASE* pObj = new STOREBASE;
pObj可能也是指向数据库的指针,好象没有Open过。应该有问题。
至于内存泄露,这是肯定的,你每做一个循环就new一个,而且没有好好初始化,你的机器估计内存比较大.
pObj是局部变量,在while右括号处,他的生命已经结束了,你在while循环外delete一个不存在的变量,肯定出事。
#9
CMapWordToPtr wtPtr;
CString key;
CObject* pObj;
POSITION pos;
for( pos = wtPtr.GetStartPosition(); pos != NULL; )
{
wtPtr.GetNextAssoc( pos, key, (CObject*&)pObj);
delete pObj;
}
CString key;
CObject* pObj;
POSITION pos;
for( pos = wtPtr.GetStartPosition(); pos != NULL; )
{
wtPtr.GetNextAssoc( pos, key, (CObject*&)pObj);
delete pObj;
}
#10
我在析构里写了:
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
但还是内存泄漏,不知为何?
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
但还是内存泄漏,不知为何?
#11
你跟过没有?
很没道理,你写有问题。
先把分给了吧!
很没道理,你写有问题。
先把分给了吧!
#12
delete无效指针是要出保护错的!!!!!
#13
我debug了,但output还是:
strcore.cpp(76) : {554} normal block at 0x007A78B0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {553} normal block at 0x007A7860, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {552} normal block at 0x007A7FB0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {551} normal block at 0x007A7E30, 36 bytes long.
Data: < z ; ;> 01 00 00 00 BC 7F 7A 00 E0 A7 1E 3B BC 9D 1F 3B
strcore.cpp(76) : {542} normal block at 0x007A7DB0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {541} normal block at 0x007A79F0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {540} normal block at 0x007A79B0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {539} normal block at 0x007A7960, 36 bytes long.
Data: < yz ; ;> 02 00 00 00 BC 79 7A 00 E0 A7 1E 3B F0 96 1F 3B
strcore.cpp(76) : {530} normal block at 0x007A7D70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {529} normal block at 0x007A7D20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {528} normal block at 0x007A7CE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {527} normal block at 0x007A7C90, 36 bytes long.
Data: < |z ; ;> 03 00 00 00 EC 7C 7A 00 E0 A7 1E 3B E0 88 1F 3B
strcore.cpp(76) : {518} normal block at 0x007A7F70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {517} normal block at 0x007A7F20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {516} normal block at 0x007A7EE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {515} normal block at 0x007A7E90, 36 bytes long.
Data: < ~z ; ;> 04 00 00 00 EC 7E 7A 00 D0 99 1E 3B E0 A7 1E 3B
strcore.cpp(76) : {506} normal block at 0x007A7C50, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {505} normal block at 0x007A7C00, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {504} normal block at 0x007A7BC0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {503} normal block at 0x007A7B70, 36 bytes long.
Data: < {z ; ;> 05 00 00 00 CC 7B 7A 00 E0 A7 1E 3B E8 8F 1F 3B
strcore.cpp(76) : {492} normal block at 0x007A7820, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {491} normal block at 0x007A77D0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {490} normal block at 0x007A7790, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {489} normal block at 0x007A7740, 36 bytes long.
Data: < wz ; ;> 06 00 00 00 9C 77 7A 00 D0 99 1E 3B E0 A7 1E 3B
why?????????????
strcore.cpp(76) : {554} normal block at 0x007A78B0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {553} normal block at 0x007A7860, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {552} normal block at 0x007A7FB0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {551} normal block at 0x007A7E30, 36 bytes long.
Data: < z ; ;> 01 00 00 00 BC 7F 7A 00 E0 A7 1E 3B BC 9D 1F 3B
strcore.cpp(76) : {542} normal block at 0x007A7DB0, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {541} normal block at 0x007A79F0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {540} normal block at 0x007A79B0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {539} normal block at 0x007A7960, 36 bytes long.
Data: < yz ; ;> 02 00 00 00 BC 79 7A 00 E0 A7 1E 3B F0 96 1F 3B
strcore.cpp(76) : {530} normal block at 0x007A7D70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {529} normal block at 0x007A7D20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {528} normal block at 0x007A7CE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {527} normal block at 0x007A7C90, 36 bytes long.
Data: < |z ; ;> 03 00 00 00 EC 7C 7A 00 E0 A7 1E 3B E0 88 1F 3B
strcore.cpp(76) : {518} normal block at 0x007A7F70, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {517} normal block at 0x007A7F20, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {516} normal block at 0x007A7EE0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {515} normal block at 0x007A7E90, 36 bytes long.
Data: < ~z ; ;> 04 00 00 00 EC 7E 7A 00 D0 99 1E 3B E0 A7 1E 3B
strcore.cpp(76) : {506} normal block at 0x007A7C50, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {505} normal block at 0x007A7C00, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {504} normal block at 0x007A7BC0, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {503} normal block at 0x007A7B70, 36 bytes long.
Data: < {z ; ;> 05 00 00 00 CC 7B 7A 00 E0 A7 1E 3B E8 8F 1F 3B
strcore.cpp(76) : {492} normal block at 0x007A7820, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE C3 E8
strcore.cpp(76) : {491} normal block at 0x007A77D0, 43 bytes long.
Data: < c:\c> 01 00 00 00 1E 00 00 00 1E 00 00 00 63 3A 5C 63
strcore.cpp(76) : {490} normal block at 0x007A7790, 27 bytes long.
Data: < 2001> 01 00 00 00 0E 00 00 00 0E 00 00 00 32 30 30 31
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264) : {489} normal block at 0x007A7740, 36 bytes long.
Data: < wz ; ;> 06 00 00 00 9C 77 7A 00 D0 99 1E 3B E0 A7 1E 3B
why?????????????
#14
能再帮我分析一下,分我会给的。
#15
跟过这儿没有?????
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
if(!m_plstStore->IsEmpty())
{
POSITION pos = m_plstStore->GetStartPosition();
while(pos != NULL)
{
STOREBASE* store;
WORD rKey;
m_plstStore->GetNextAssoc(pos, rKey, (void*&)store);
delete store;
}
m_plstStore->RemoveAll();
}
delete m_plstStore;
#16
尤其delete store;这一行。
#17
你等一下,我跟一下
#18
pSlowSet->m_pro_index有没有重复???
我个人认为:阁下编程习惯有问题。
我个人认为:阁下编程习惯有问题。
#19
跟的怎么样才算对呢?
#20
delete一个有效指针,
delete次数和new的次数一样。
delete次数和new的次数一样。
#21
delete和new是一样多的,是否我把代码没放在析构函数中,我放在OnDestory()
#22
sorry,OnDestroy()
#23
C:\WINDOWS\Desktop\AutoSlow新_2_mn\AutoSlow1Dlg.cpp(2264)
是哪行?
是哪行?
#24
与 SuperProgMan(编程者) 商量一下:
我认为这样会稍好一点。
STOREBASE* pObj = new STOREBASE;
pObj->Open();
while(!pSlowSet->IsEOF())
{
// ..................
}
pObj->Close();
delete pObj;
如果用try,catch,throw更好
我认为这样会稍好一点。
STOREBASE* pObj = new STOREBASE;
pObj->Open();
while(!pSlowSet->IsEOF())
{
// ..................
}
pObj->Close();
delete pObj;
如果用try,catch,throw更好
#25
STOREBASE的结构是什么样?
#26
to ahphone(《风云3》里头劫镖的:
有道理
有道理
#27
#ifndef _MYDEFINE_H_
#define _MYDEFINE_H_
typedef struct tagStore{
long nIndex; //索引
CString strTheme; //主题
CTime StartTime; //开始时间
CTime EndTime; //结束时间
CString strFileName; //文件路径
long nTdh; //通道号
CString tdhMs; //通道号描述
BOOL isDel; //是否删除
CString strweek;
//BOOL bDs; //是否定时
}STOREBASE;
#endif
#define _MYDEFINE_H_
typedef struct tagStore{
long nIndex; //索引
CString strTheme; //主题
CTime StartTime; //开始时间
CTime EndTime; //结束时间
CString strFileName; //文件路径
long nTdh; //通道号
CString tdhMs; //通道号描述
BOOL isDel; //是否删除
CString strweek;
//BOOL bDs; //是否定时
}STOREBASE;
#endif
#28
to jxxfy(许方勇):
ahphone(《风云3》里头劫镖的) 说法有道理!
ahphone(《风云3》里头劫镖的) 说法有道理!
#29
to jxxfy(许方勇):
对不起,我一直用STL,没用过CMapWordToPtr。
按《ahphone(《风云3》里头劫镖的)》的做应该没问题。
对不起,我一直用STL,没用过CMapWordToPtr。
按《ahphone(《风云3》里头劫镖的)》的做应该没问题。