word crashes on exit after calling add-in

A

ajfish

Hi,

I have written a COM add-in for word in VB6. On some PCs There were
problems with word crashing with a memory access violation in msvbvm60
after exiting the word if the add-on had been called.

after a large amount of trial and error, I discovered that if I hide
the main form (using "me.hide"), the crash happens on exiting word, but
if I instead unload it (using "unload me") there is no crash.

I thought that the VB runtime was supposed to do the memory management
for me, and automatically free any resources when it exits. am I doing
something wrong here or are there some extra rules about using vb6 as a
COM add-in?

to be safe, are there other things I need to explicitly free or unload?

TIA

Andy
 
K

Ken Slovak - [MVP - Outlook]

In any COM addin you must handle all errors and release all of your objects.
Do not rely on the VB 6 runtime to do things for you in a COM addin.
 

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