Sink events of context menu item 1235711

T

Tamir

Hi,
I wrote an addin for ms-word.
In my addin I add an item to the context menu.
Im trying to sink the events of my new menu item with no success.
Probably its because Im sinking mistaken type of events i.e.
_CommandBarButtonEvents.
I tried to sink the CommandBarsEvents but couldnt find a connection point to
it.

Im working with C++ but any help in ANY programing language will
still help a lot.

Best regards.
 
D

David

Hi Tamir
I have similar addin for Word , though with commandbar buttons but I guess
its all the same.

in my class definitian I added this :

public
IDispEventSimpleImpl<26,CAddinConnect,&__uuidof(Office::_CommandBarButtonEvents)>,

in SINK_MAP I go this :
SINK_ENTRY_INFO(26, __uuidof(Office::_CommandBarButtonEvents),/*dispid*/
0x01, OnClickOnOff, &OnClickButtonInfo)

and typedef :
typedef IDispEventSimpleImpl</*nID =*/ 26, CAddinConnect,
&__uuidof(Office::_CommandBarButtonEvents)> CommandOnOffEvents;

and ATL info struct :
_ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};


this works fine for me.
Hope this info will help you.
David
 
T

Tamir

Hi David,
Thanks for your reply, I have already succeeded in sinking the context menu
item but as sun as I started to enjoy from my results my addin stopped
loading. Moreover, old backups are also blocked. when trying to debug, all
breakpoints are marked question-marks and ms-word loads without my addin. I
dont have any compilation errors and I dont use managed-extensions DO YOU
HAVE ANY IDEA, Im totally lost ... I dont have a clue!

[
I tried to see if my addin is disabled by ms-word (Help->About->"Disabled
Items")
but it is not disabled.
]
Cindy M. wrote to me that it may be related to a SHIM, but after some
reading I understand that SHIM is related to managed code - and I use
UNmanaged code.

IM TOTALLY LOST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Best regards, and gmar hatima tova :)
 
D

David

Hi Tamir.
It seems Word is loading wrong binary of your addin.
1) Try to unregister and delete your dll file
2) Use Sysinternal process explorer to determine which version of your dll
is loaded into Word's working process
3) If dll is correct try to attach your project to running winword.exe process

What version of VS R U using ?
במידה ויש צורך ×× ×™ ×תן email שלי
David


Tamir said:
Hi David,
Thanks for your reply, I have already succeeded in sinking the context menu
item but as sun as I started to enjoy from my results my addin stopped
loading. Moreover, old backups are also blocked. when trying to debug, all
breakpoints are marked question-marks and ms-word loads without my addin. I
dont have any compilation errors and I dont use managed-extensions DO YOU
HAVE ANY IDEA, Im totally lost ... I dont have a clue!

[
I tried to see if my addin is disabled by ms-word (Help->About->"Disabled
Items")
but it is not disabled.
]
Cindy M. wrote to me that it may be related to a SHIM, but after some
reading I understand that SHIM is related to managed code - and I use
UNmanaged code.

IM TOTALLY LOST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Best regards, and gmar hatima tova :)


David said:
Hi Tamir
I have similar addin for Word , though with commandbar buttons but I guess
its all the same.

in my class definitian I added this :

public
IDispEventSimpleImpl<26,CAddinConnect,&__uuidof(Office::_CommandBarButtonEvents)>,

in SINK_MAP I go this :
SINK_ENTRY_INFO(26, __uuidof(Office::_CommandBarButtonEvents),/*dispid*/
0x01, OnClickOnOff, &OnClickButtonInfo)

and typedef :
typedef IDispEventSimpleImpl</*nID =*/ 26, CAddinConnect,
&__uuidof(Office::_CommandBarButtonEvents)> CommandOnOffEvents;

and ATL info struct :
_ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};


this works fine for me.
Hope this info will help you.
David
 
T

Tamir

Hi David,
I used Sysinternal process explorer to determine the version of the loaded dll
and as it seems my dll is not being loaded at all, not even a wrong version.
Im using "Microsoft Visual Studio 2003".
The most amazing part is that previously working backups doesnt work anymore.

Best regards.



David said:
Hi Tamir.
It seems Word is loading wrong binary of your addin.
1) Try to unregister and delete your dll file
2) Use Sysinternal process explorer to determine which version of your dll
is loaded into Word's working process
3) If dll is correct try to attach your project to running winword.exe process

What version of VS R U using ?
במידה ויש צורך ×× ×™ ×תן email שלי
David


Tamir said:
Hi David,
Thanks for your reply, I have already succeeded in sinking the context menu
item but as sun as I started to enjoy from my results my addin stopped
loading. Moreover, old backups are also blocked. when trying to debug, all
breakpoints are marked question-marks and ms-word loads without my addin. I
dont have any compilation errors and I dont use managed-extensions DO YOU
HAVE ANY IDEA, Im totally lost ... I dont have a clue!

[
I tried to see if my addin is disabled by ms-word (Help->About->"Disabled
Items")
but it is not disabled.
]
Cindy M. wrote to me that it may be related to a SHIM, but after some
reading I understand that SHIM is related to managed code - and I use
UNmanaged code.

IM TOTALLY LOST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Best regards, and gmar hatima tova :)


David said:
Hi Tamir
I have similar addin for Word , though with commandbar buttons but I guess
its all the same.

in my class definitian I added this :

public
IDispEventSimpleImpl<26,CAddinConnect,&__uuidof(Office::_CommandBarButtonEvents)>,

in SINK_MAP I go this :
SINK_ENTRY_INFO(26, __uuidof(Office::_CommandBarButtonEvents),/*dispid*/
0x01, OnClickOnOff, &OnClickButtonInfo)

and typedef :
typedef IDispEventSimpleImpl</*nID =*/ 26, CAddinConnect,
&__uuidof(Office::_CommandBarButtonEvents)> CommandOnOffEvents;

and ATL info struct :
_ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};


this works fine for me.
Hope this info will help you.
David

:

Hi,
I wrote an addin for ms-word.
In my addin I add an item to the context menu.
Im trying to sink the events of my new menu item with no success.
Probably its because Im sinking mistaken type of events i.e.
_CommandBarButtonEvents.
I tried to sink the CommandBarsEvents but couldnt find a connection point to
it.

Im working with C++ but any help in ANY programing language will
still help a lot.

Best regards.
 
D

David

what about registry entries?
All MS Office applications load addins by thier Prog Id. For instance your
Outlook addins are in :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins
Word addins are in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins
etc. Same keys are in HKCU hive in case your adddin is user-specific. Take
a look at these keys and create similar key for your addin if needed. There
is an article in MSDN which describes all these settings.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/comaddins.asp

Example is in VB but this doesnt really mater.
Hope this helps.
David

Tamir said:
Hi David,
I used Sysinternal process explorer to determine the version of the loaded dll
and as it seems my dll is not being loaded at all, not even a wrong version.
Im using "Microsoft Visual Studio 2003".
The most amazing part is that previously working backups doesnt work anymore.

Best regards.



David said:
Hi Tamir.
It seems Word is loading wrong binary of your addin.
1) Try to unregister and delete your dll file
2) Use Sysinternal process explorer to determine which version of your dll
is loaded into Word's working process
3) If dll is correct try to attach your project to running winword.exe process

What version of VS R U using ?
במידה ויש צורך ×× ×™ ×תן email שלי
David


Tamir said:
Hi David,
Thanks for your reply, I have already succeeded in sinking the context menu
item but as sun as I started to enjoy from my results my addin stopped
loading. Moreover, old backups are also blocked. when trying to debug, all
breakpoints are marked question-marks and ms-word loads without my addin. I
dont have any compilation errors and I dont use managed-extensions DO YOU
HAVE ANY IDEA, Im totally lost ... I dont have a clue!

[
I tried to see if my addin is disabled by ms-word (Help->About->"Disabled
Items")
but it is not disabled.
]
Cindy M. wrote to me that it may be related to a SHIM, but after some
reading I understand that SHIM is related to managed code - and I use
UNmanaged code.

IM TOTALLY LOST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Best regards, and gmar hatima tova :)


:

Hi Tamir
I have similar addin for Word , though with commandbar buttons but I guess
its all the same.

in my class definitian I added this :

public
IDispEventSimpleImpl<26,CAddinConnect,&__uuidof(Office::_CommandBarButtonEvents)>,

in SINK_MAP I go this :
SINK_ENTRY_INFO(26, __uuidof(Office::_CommandBarButtonEvents),/*dispid*/
0x01, OnClickOnOff, &OnClickButtonInfo)

and typedef :
typedef IDispEventSimpleImpl</*nID =*/ 26, CAddinConnect,
&__uuidof(Office::_CommandBarButtonEvents)> CommandOnOffEvents;

and ATL info struct :
_ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};


this works fine for me.
Hope this info will help you.
David

:

Hi,
I wrote an addin for ms-word.
In my addin I add an item to the context menu.
Im trying to sink the events of my new menu item with no success.
Probably its because Im sinking mistaken type of events i.e.
_CommandBarButtonEvents.
I tried to sink the CommandBarsEvents but couldnt find a connection point to
it.

Im working with C++ but any help in ANY programing language will
still help a lot.

Best regards.
 
D

David

another link :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/msotrcom.asp

Tamir said:
Hi David,
I used Sysinternal process explorer to determine the version of the loaded dll
and as it seems my dll is not being loaded at all, not even a wrong version.
Im using "Microsoft Visual Studio 2003".
The most amazing part is that previously working backups doesnt work anymore.

Best regards.



David said:
Hi Tamir.
It seems Word is loading wrong binary of your addin.
1) Try to unregister and delete your dll file
2) Use Sysinternal process explorer to determine which version of your dll
is loaded into Word's working process
3) If dll is correct try to attach your project to running winword.exe process

What version of VS R U using ?
במידה ויש צורך ×× ×™ ×תן email שלי
David


Tamir said:
Hi David,
Thanks for your reply, I have already succeeded in sinking the context menu
item but as sun as I started to enjoy from my results my addin stopped
loading. Moreover, old backups are also blocked. when trying to debug, all
breakpoints are marked question-marks and ms-word loads without my addin. I
dont have any compilation errors and I dont use managed-extensions DO YOU
HAVE ANY IDEA, Im totally lost ... I dont have a clue!

[
I tried to see if my addin is disabled by ms-word (Help->About->"Disabled
Items")
but it is not disabled.
]
Cindy M. wrote to me that it may be related to a SHIM, but after some
reading I understand that SHIM is related to managed code - and I use
UNmanaged code.

IM TOTALLY LOST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Best regards, and gmar hatima tova :)


:

Hi Tamir
I have similar addin for Word , though with commandbar buttons but I guess
its all the same.

in my class definitian I added this :

public
IDispEventSimpleImpl<26,CAddinConnect,&__uuidof(Office::_CommandBarButtonEvents)>,

in SINK_MAP I go this :
SINK_ENTRY_INFO(26, __uuidof(Office::_CommandBarButtonEvents),/*dispid*/
0x01, OnClickOnOff, &OnClickButtonInfo)

and typedef :
typedef IDispEventSimpleImpl</*nID =*/ 26, CAddinConnect,
&__uuidof(Office::_CommandBarButtonEvents)> CommandOnOffEvents;

and ATL info struct :
_ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};


this works fine for me.
Hope this info will help you.
David

:

Hi,
I wrote an addin for ms-word.
In my addin I add an item to the context menu.
Im trying to sink the events of my new menu item with no success.
Probably its because Im sinking mistaken type of events i.e.
_CommandBarButtonEvents.
I tried to sink the CommandBarsEvents but couldnt find a connection point to
it.

Im working with C++ but any help in ANY programing language will
still help a lot.

Best regards.
 
T

Tamir

Hi David,
תודה על העזרה.
I tried what you suggested and I see that my dll is not loaded at all, not
even an old version of it. Moreover, there is a mode in ms-word which lets
you disable/enable each dll before being loaded by word (this mode can be set
by: Tools|Macro|Security--set the level to medium AND on the "Trusted
Publisher" tab uncheck all options) .... In this mode each of the dll's are
loaded step-by-step BUT MY DLL IS NOT LOADED !!!!

Its the first time for me in which I REALLY dont have a clue - it is totally
a mystery.

Taking into account that the computer used for development is not connected
to the Internet and does not update makes it even more strange.
I tried to run it on another computer but with no success.
I consider on starting from scratch and copy-past my code step-by-step until
getting it to work.

Do you know a way to reset all office settings, someone told me there is
something in the registry that can be deleted, which will reset all of office
settings. I would like to try it.

Best regards.


David said:
another link :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/msotrcom.asp

Tamir said:
Hi David,
I used Sysinternal process explorer to determine the version of the loaded dll
and as it seems my dll is not being loaded at all, not even a wrong version.
Im using "Microsoft Visual Studio 2003".
The most amazing part is that previously working backups doesnt work anymore.

Best regards.



David said:
Hi Tamir.
It seems Word is loading wrong binary of your addin.
1) Try to unregister and delete your dll file
2) Use Sysinternal process explorer to determine which version of your dll
is loaded into Word's working process
3) If dll is correct try to attach your project to running winword.exe process

What version of VS R U using ?
במידה ויש צורך ×× ×™ ×תן email שלי
David


:

Hi David,
Thanks for your reply, I have already succeeded in sinking the context menu
item but as sun as I started to enjoy from my results my addin stopped
loading. Moreover, old backups are also blocked. when trying to debug, all
breakpoints are marked question-marks and ms-word loads without my addin. I
dont have any compilation errors and I dont use managed-extensions DO YOU
HAVE ANY IDEA, Im totally lost ... I dont have a clue!

[
I tried to see if my addin is disabled by ms-word (Help->About->"Disabled
Items")
but it is not disabled.
]
Cindy M. wrote to me that it may be related to a SHIM, but after some
reading I understand that SHIM is related to managed code - and I use
UNmanaged code.

IM TOTALLY LOST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Best regards, and gmar hatima tova :)


:

Hi Tamir
I have similar addin for Word , though with commandbar buttons but I guess
its all the same.

in my class definitian I added this :

public
IDispEventSimpleImpl<26,CAddinConnect,&__uuidof(Office::_CommandBarButtonEvents)>,

in SINK_MAP I go this :
SINK_ENTRY_INFO(26, __uuidof(Office::_CommandBarButtonEvents),/*dispid*/
0x01, OnClickOnOff, &OnClickButtonInfo)

and typedef :
typedef IDispEventSimpleImpl</*nID =*/ 26, CAddinConnect,
&__uuidof(Office::_CommandBarButtonEvents)> CommandOnOffEvents;

and ATL info struct :
_ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};


this works fine for me.
Hope this info will help you.
David

:

Hi,
I wrote an addin for ms-word.
In my addin I add an item to the context menu.
Im trying to sink the events of my new menu item with no success.
Probably its because Im sinking mistaken type of events i.e.
_CommandBarButtonEvents.
I tried to sink the CommandBarsEvents but couldnt find a connection point to
it.

Im working with C++ but any help in ANY programing language will
still help a lot.

Best regards.
 

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