why word2003 always crushed if my addin registered?

H

holk leng

I wrote a word addin dll by ATL, my purpose is to be notified to extract some
content text when the document is being closed. My addin runs well on
word2000,but always crushed with word2003 when closing the word application.

here is my sample code:
public IDispatchImpl<IAddin, &IID_IAddin, &LIBID_BDSWORDADDINLib>,
public IDispatchImpl<_IDTExtensibility2, &IID__IDTExtensibility2,
&LIBID_AddInDesignerObjects>,
public IDispEventSimpleImpl<1,CAddin,&__uuidof(MSWord::ApplicationEvents2)>
......
BEGIN_SINK_MAP(CAddin)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),2,Quit,&QuitInfo)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),4,DocumentOpen,&DocumentOpenInfo)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),6,DocumentBeforeClose,&DocumentSaveInfo)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),8,DocumentBeforeSave,&DocumentBeforeSaveInfo)
END_SINK_MAP()

I found if I comment out the DocumentBeforeClose event sink above
,everything is ok, or else error occurs when closing the application, even I
let the DocumentBeforeClose function do nothing.

why? Could someone tell me the solution to handle this? Thanks.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?aG9sayBsZW5n?=,

If you'd bothered to read any of the messages in this group before posting, you'd have noticed it's a
group targeted at end users. No programming content. Try asking your question in the office.comAddIns
newsgroup.
I wrote a word addin dll by ATL, my purpose is to be notified to extract some
content text when the document is being closed. My addin runs well on
word2000,but always crushed with word2003 when closing the word application.

here is my sample code:
public IDispatchImpl<IAddin, &IID_IAddin, &LIBID_BDSWORDADDINLib>,
public IDispatchImpl<_IDTExtensibility2, &IID__IDTExtensibility2,
&LIBID_AddInDesignerObjects>,
public IDispEventSimpleImpl<1,CAddin,&__uuidof(MSWord::ApplicationEvents2)>
......
BEGIN_SINK_MAP(CAddin)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),2,Quit,&QuitInfo)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),4,DocumentOpen,&DocumentOpenInfo)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),6,DocumentBeforeClose,&DocumentSaveInfo)
SINK_ENTRY_INFO(1,__uuidof(MSWord::ApplicationEvents2),8,DocumentBeforeSave,&DocumentBeforeSaveInfo)
END_SINK_MAP()

I found if I comment out the DocumentBeforeClose event sink above
,everything is ok, or else error occurs when closing the application, even I
let the DocumentBeforeClose function do nothing.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and
not by e-mail :)
 

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