how to reference shimmed COMAddIn from vbscript?

Add-in Express™ Support Service
That's what is more important than anything else

how to reference shimmed COMAddIn from vbscript?
 
Thomas Reinberger




Posts: 5
Joined: 2005-10-09
Hi Sergey,

The following code works fine without shim:
Set objAddIn = Item.Application.COMAddIns.Item("MyAddIn.AddinModule").Object
objAddIn.operationFromAddinModule "param1","param2"

now with shim:

Set objAddIn = Item.Application.COMAddIns.Item("MyAddInShim.Proxy").Object
The Problem is: i have now the Proxy object, but not the MyAddIn.AddinModule object,
I want to call operationFromAddinModule, how can i do this?
or how can i get the MyAddIn.AddinModule object of the shimmed Addin from vbscript?

ps: I have installed Add-in Express .NET for Visual Studio 2003






Posted 15 Oct, 2006 12:28:25 Top
Thomas Guenther




Posts: 94
Joined: 2006-02-20
Hi Thomas!

I developed a project where i also needed a reference to the Addin from VBScript.

Your objAddIn variable holds an instance of the 'ADXRemoteObject' on this way.

If you have a look into the documentation you will see that this object has the following methods:

a) CallMethod(string, object[])
b) GetProperty(string, object[])
c) GetProperty(string)
d) SetProperty(string, object, object[])
e) SetProperty(string, object)

Now if you have a property "MyProperty" in your AddinModule-Class
You can read the value of this property by calling the GetProperty-method as follows:

myPropValue = objAddIn.GetProperty("MyProperty")

and setting the property:

objAddIn.GetProperty "MyProperty", [myValue]

However i couldn't get the method CallMethod to work, because creating an array holding the parameter values and set this array as object[] parameter of the CallMethod method always failed.

But the CallMethod-method works fine in VB6.

Hope i could Help you a little bit,


Best regards,
Thomas Guenther
Posted 16 Oct, 2006 03:44:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thomas.

Thank you for the help.
I will change the CallMethod method in the next ADX build.
Posted 16 Oct, 2006 09:07:22 Top
Thomas Reinberger




Posts: 5
Joined: 2005-10-09
Hi Thomas,

Thank you very much for your Tip!

I'll write a component in VB6 and then use the CallMethod-method.
:)
Posted 16 Oct, 2006 09:40:09 Top
Thomas Guenther




Posts: 94
Joined: 2006-02-20
Hi Thomas!

Thats exactly what we did to get it to work...

If you run into problems, just reply to this thread or drop me a mail and i'll see if i can help you.

Good luck!

Ciao,
Thomas
Posted 17 Oct, 2006 02:23:02 Top