Trans Excel data in VC

R

Rate

// using Excel 2000
void CExcelOpeDlg::TransUpData(Range &desRge, Range &sourceRge, int
desSheetIndex, int ZoneIndex)
{
_variant_t OrderNum, PeopleNum;
//
OrderNum =
sourceRge.GetItem(_variant_t((long)m_UpDataAddupRow),_variant_t((long)2));
PeopleNum =
sourceRge.GetItem(_variant_t((long)m_UpDataAddupRow),_variant_t((long)3));

if (0 == desSheetIndex)
{
desRge.SetItem(_variant_t((long)(m_OrderNumLastYWRow + 1)),
_variant_t((long)(ZoneIndex + 1)), OrderNum);
desRge.SetItem(_variant_t((long)(m_OrderNumLastYWRow + 2)),
_variant_t((long)(ZoneIndex + 1)), PeopleNum);
}
else if (1 == desSheetIndex)
{
desRge.SetItem(_variant_t((long)(m_DetailedTableLastYWRow + 1)),
_variant_t((long)(ZoneIndex * 2)), OrderNum);
desRge.SetItem(_variant_t((long)(m_DetailedTableLastYWRow + 1)),
_variant_t((long)(ZoneIndex * 2 + 1)), PeopleNum);
}
}

I just want to get a data from sourceRge and write to desRge.

I find when my application call this fun many times, the memory used by both
excel.exe and app.exe are all increased, and when app.exe is ended ,
execel.exe is still running.

When I don't call this fun, the situation can not be seen.

Is this a memory leak?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top