Click here to Skip to main content
15,924,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: will someone look here................................................................................. Pin
yang__lee4-May-06 0:37
yang__lee4-May-06 0:37 
GeneralRe: will someone look here................................................................................. Pin
Cedric Moonen4-May-06 0:54
Cedric Moonen4-May-06 0:54 
GeneralRe: will someone look here................................................................................. Pin
Cedric Moonen4-May-06 1:28
Cedric Moonen4-May-06 1:28 
GeneralRe: will someone look here................................................................................. Pin
Cedric Moonen4-May-06 1:49
Cedric Moonen4-May-06 1:49 
GeneralRe: will someone look here................................................................................. Pin
yang__lee4-May-06 2:40
yang__lee4-May-06 2:40 
GeneralRe: will someone look here................................................................................. Pin
Cedric Moonen4-May-06 3:10
Cedric Moonen4-May-06 3:10 
QuestionHow do I change the menubar's background ? Pin
Happy frog3-May-06 22:34
Happy frog3-May-06 22:34 
QuestionMemory leak coming from COleSafeArray object Pin
lastgen3-May-06 22:31
lastgen3-May-06 22:31 
I must be missing something in the cleanup, but here is a cut version of the code that causes the leak.

<br />
// ... an Excel file has been loaded already into oSheet<br />
CExcelRange usedCells = oSheet.get_UsedRange();<br />
<br />
// Copy used cells to array - It is this line of code that causes the leak<br />
/****************************************************/<br />
COleSafeArray cellArray(usedCells.get_Value());<br />
/****************************************************/<br />
<br />
usedCells.Clear();<br />
usedCells.ReleaseDispatch();<br />
VariantClear(cellArray);<br />
cellArray.Clear();<br />
cellArray.Detach();<br />
// ...close down excel etc etc<br />


I have deliberately cut down my code for testing so it essentially does nothing but load the file. There is no code between "COleSafeArray cellArray(usedCells.get_Value());" and "usedCells.Clear();" to help narrow down the leak.
If I comment out the line "COleSafeArray cellArray(usedCells.get_Value());" (and oviously the associated cleanup so it will compile) I have no leak, but if it calls this line I get an immediate loss of ~4-5 times the file size which equates to about 30 meg per file. If I run this multiple times it continues to drop, so I don't think it is a windows caching problem. Anybody know what I'm missing?

When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
AnswerRe: Memory leak coming from COleSafeArray object Pin
lastgen3-May-06 23:33
lastgen3-May-06 23:33 
Questionverify Windows Firewall settings Pin
QuickDeveloper3-May-06 22:23
QuickDeveloper3-May-06 22:23 
Questionwhy dose this happen in class wizard of vc++ 6.0 Pin
ewighell3-May-06 22:10
ewighell3-May-06 22:10 
AnswerRe: why dose this happen in class wizard of vc++ 6.0 Pin
Monty23-May-06 22:13
Monty23-May-06 22:13 
QuestionAdding Documents to F1 Pin
parichaybp3-May-06 21:53
parichaybp3-May-06 21:53 
AnswerAdding Documents to F1 Pin
kk.tvm3-May-06 23:06
kk.tvm3-May-06 23:06 
GeneralRe: Adding Documents to F1 Pin
parichaybp3-May-06 23:10
parichaybp3-May-06 23:10 
GeneralRe: Adding Documents to F1 Pin
parichaybp3-May-06 23:12
parichaybp3-May-06 23:12 
AnswerRe: Adding Documents to F1 Pin
Maxwell Chen3-May-06 23:14
Maxwell Chen3-May-06 23:14 
QuestionSpecial folders on remote machine Pin
Mila0253-May-06 21:46
Mila0253-May-06 21:46 
Questionfinding Audio Level Pin
atimpoo3-May-06 21:17
atimpoo3-May-06 21:17 
AnswerRe: finding Audio Level Pin
Nishad S3-May-06 21:26
Nishad S3-May-06 21:26 
AnswerRe: finding Audio Level Pin
Remco Hoogenboezem3-May-06 21:43
Remco Hoogenboezem3-May-06 21:43 
GeneralRe: finding Audio Level Pin
atimpoo3-May-06 23:34
atimpoo3-May-06 23:34 
AnswerRe: finding Audio Level Pin
normanS4-May-06 19:51
normanS4-May-06 19:51 
QuestionRe: finding Audio Level Pin
atimpoo5-May-06 0:00
atimpoo5-May-06 0:00 
AnswerRe: finding Audio Level Pin
normanS7-May-06 19:19
normanS7-May-06 19:19 

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.