Memory Leaks when using Shellexecute 
Author Message
 Memory Leaks when using Shellexecute

I managed to use ShellExecute to open a Visual Basic app that opens and
modifies
an Access database, but when I close it and then close the VC++ app
my debug info reports memory leaks. I've examined my VB code
and can't seem to find anything that is left undone. Does anyone out here
have any sugestions
Thank you
Steve



Wed, 20 Oct 1999 03:00:00 GMT  
 Memory Leaks when using Shellexecute

Steven E Serrell

Quote:
>I managed to use ShellExecute to open a Visual Basic app that opens and
>modifies
>an Access database, but when I close it and then close the VC++ app
>my debug info reports memory leaks. I've examined my VB code
>and can't seem to find anything that is left undone. Does anyone out here
>have any sugestions

The MFC&T debugging functions and macros can only see what goes through
'new', 'malloc', 'delete', etc. They can't see inside 'AllocMem' (sic?) or
'ShellExecute'. If, just before 'exit' returned your program to the OS, you
owed a zillion megabytes, those debugging macros will not report it. I
suspect you could detect such a leak by examining your low-level memory
handles (as per /Advanced Windows/ by Jeff Ritcher), but you would be
hard-pressed to detect memory loss by another program. The OS reclaims
everything even if your child app does not explicitely free anything, so by
the time you exit (according to your sequence of events), all the VB is
washed out of memory.

Besides, the "memory fairy" inside VB always cleans up after anything you
do (except, of course, for API calls like 'AllocMem').

To test this, write a tiny non-VB program that spoofs whatever your child
app was doing to your main app. Forget about the Jet database - just make
sure the program permits your main program to follow its normal paths. See
if you still have the leak. It is probably just a normal memory leak from
somewhere in your logic.

  --  Phlip
======= http://users.deltanet.com/~tegan/home.html =======
  --  My opinions are mine alone!
        If someone agrees with me, I'l change them!  --



Thu, 21 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. debugger detects memory leak after using shellexecute

2. Memory leak when using Memory DC

3. Memory leak when using an array of pointer

4. Help - Memory Leak Using CDatabase

5. Using memory leaks detection

6. MEMORY LEAK using CDaoRecordset Class and AddNew() method

7. Memory leak when using UpdateBatch within Adodc

8. Memory Leaks using CDaoDatabase

9. Memory leak when using MSVC6 Rectangle function

10. Microsoft DOM Leaking Memory using LoadXML

11. Virtual Memory Leaks using debugger

12. Using SysFreeString to avoid memory leak?

 

 
Powered by phpBB® Forum Software