Discussion:
word crashes on exit after calling add-in
(too old to reply)
a***@blueyonder.co.uk
2006-09-15 14:25:36 UTC
Permalink
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
Ken Slovak - [MVP - Outlook]
2006-09-15 15:42:32 UTC
Permalink
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.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
Post by a***@blueyonder.co.uk
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
Loading...