Addin.RequestComAddinAutomationService not executed

T

tanutatu

Hi All

We are using VSTO SE, C# to build an Outlook 2007 add-in.

We wanted to expose the functionality of this addin to external
programs.
So we overrode the RequestComAddinAutomationService method .
This method is supposed to be called whenever add-in loads, according
to
documentation.

But problem is that, intermittently, this function doesnt get called
for some reason and hence the application.Comaddins(MyAddin).Object
returns a null value.

can someone point out the situations when this function isnt called
during add-in load?

Regards
Tanushree
 
T

tanutatu

Hi,
Thanks for the reply.
I had already taken care of the criteria
Following are the attributes that i set for the class :
----------------------------
[System.Runtime.InteropServices.ComVisibleAttribute(true)]

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)]
public class ClassThatExposesAddinFunctions
{
};

Is there anything else that i need to take care of ?

Anyway the main problem is that : sometimes, the function
RequestComAddinAutomationService() "doesnt" get called at all !!!!
In what situations does this happen???

Regards
Tanushree
 
P

Pete

A couple more questions then:

How do you know that RequestComAddinAutomationService is not being called?
Are you assuming that is the case because the Object property returns null?
Are you sucessfully getting a reference to the Office application hosting
your add-in?

What are you doing differently when you believe this method isn't being
called, i.e. are you running exactly the same code and finding sometimes it
works and sometimes it doesn't?

Pete

Hi,
Thanks for the reply.
I had already taken care of the criteria
Following are the attributes that i set for the class :
----------------------------
[System.Runtime.InteropServices.ComVisibleAttribute(true)]

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)]
public class ClassThatExposesAddinFunctions
{
};

Is there anything else that i need to take care of ?

Anyway the main problem is that : sometimes, the function
RequestComAddinAutomationService() "doesnt" get called at all !!!!
In what situations does this happen???

Regards
Tanushree


Hi,

The object you return in your overloaded function must meet certain criteria
or you will get a null when you try to reference it. I found this link quite
useful:

http://msdn2.microsoft.com/en-us/library/microsoft.office.tools.addin...

Pete










- Show quoted text -
 
T

Tanushree

Hi
Thanks for your replies. My answers to your question are inline:

How do you know that RequestComAddinAutomationService is not being called?
---I use logs for this.

Are you assuming that is the case because the Object property returns null?
----Well, i intermittently got the Object property as null, so I put logs in
the function RequestComAddinAutomationService and found out that it wasnt
being executed smtimes.

Are you sucessfully getting a reference to the Office application hosting
your add-in? ---Yes

What are you doing differently when you believe this method isn't being
called, i.e. are you running exactly the same code and finding sometimes it
works and sometimes it doesn't?----Yes, I am not doing anything different

Thanks for your help

Regards
Tanushree


Pete said:
A couple more questions then:

How do you know that RequestComAddinAutomationService is not being called?
Are you assuming that is the case because the Object property returns null?
Are you sucessfully getting a reference to the Office application hosting
your add-in?

What are you doing differently when you believe this method isn't being
called, i.e. are you running exactly the same code and finding sometimes it
works and sometimes it doesn't?

Pete

Hi,
Thanks for the reply.
I had already taken care of the criteria
Following are the attributes that i set for the class :
----------------------------
[System.Runtime.InteropServices.ComVisibleAttribute(true)]

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)]
public class ClassThatExposesAddinFunctions
{
};

Is there anything else that i need to take care of ?

Anyway the main problem is that : sometimes, the function
RequestComAddinAutomationService() "doesnt" get called at all !!!!
In what situations does this happen???

Regards
Tanushree


Hi,

The object you return in your overloaded function must meet certain criteria
or you will get a null when you try to reference it. I found this link quite
useful:

http://msdn2.microsoft.com/en-us/library/microsoft.office.tools.addin...

Pete



:
Hi All

We are using VSTO SE, C# to build an Outlook 2007 add-in.

We wanted to expose the functionality of this addin to external
programs.
So we overrode the RequestComAddinAutomationService method .
This method is supposed to be called whenever add-in loads, according
to
documentation.

But problem is that, intermittently, this function doesnt get called
for some reason and hence the application.Comaddins(MyAddin).Object
returns a null value.

can someone point out the situations when this function isnt called
during add-in load?

Regards
Tanushree- Hide quoted text -

- Show quoted text -
 

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