-
It is possible to support the “new” operator in VSTA add-ins. Integration styles which do not use a full proxy, such as NoRuntime and ProxyShim, can easily support this feature. All that is required is public constructor methods in the host application. In the ShapeAppDyanmicProgrammingModelCSharp...
-
There are many different ways to manage add-ins. Below are some common add-in management styles which can be used alone, combined, or used side by side. 1) Basic: all interactions between the host and add-ins are executed in the Startup and Shutdown methods of the add-in. This is demonstrated in the...
-
As mentioned in Gary's blog Dependent Assembly Binding Redirect (by version) , it is possible to use a configuration file to change which version of an assembly to use. This can be very helpful in "tight versioning" scenarios (see blog Proxy Versioning Options for Project Templates ) where...
-
The ShapeAppCSharpMacroRecordingCSharp-NoRuntime sample (not included in SDK, please contact info@summsoft.com for more information) has many benefits over the normal SDK style integration. These benefits include less memory usage (up to a factor of 10), faster load/unload and processing time for add...
-
You can change a proxy to make the methods within the hostType class accessible by: 1) Remove the abstract keyword from the type declaration (drawback- add-ins will now be able to write code like “Application app = new Application();” instead of being forced to use factory methods). 2) Replace...
-
The HostMemberAttributes are used to reconcile name changes. When there is no name change the attribute is unnecessary. VSTA runtime uses this attribute, if available, to determine which type/method to call in the host. For example, if we change the method name for Application.NewDocument to Application...
-
Q : What can you tell me about the communication and the transfer of the arguments between the host OM and proxy? A : I believe currently there is no further documentation on this (btw, the on-line documentation is more current than the documentation included with the SDK so please refer to that; although...
-
Q : In VSTA, the developer has to use ProxyGen to create new objects and the end user can then use the "proxy objects." Why can't the end user just use the "origin objects?" A : Using the original objects may be possible. If the end user's customization does not need to be...
-
Q : I have a question regarding the project references to the proxies. As I understand it, I create the proxy dll’s for my COM type libraries. Then I make my VSTA projects reference those proxy assemblies. I envision I would do that as part of my project templates so that my users could use them...
-
Q : I'm having problem loading the addin dll's. I followed the ShapeAppMacroRecordingCSharp sample and used the following steps, 1. InstantiateServiceProvider() 2. LoadAddins() 'This function compiles the path for each dll to be loaded and invokes the LoadAddin() on each dll 3. LoadAddin...
-
The MS VSTA team has provided 2 examples of running VSTA without the proxy. Both cases simply and directly connect the add-in to the host application. Summit devs looked at these examples and offer this guidance: == The first example is the script task in SQL Server Integration Services (SSIS) Business...
-
Q : I’m using ShapeAppBasicCSharp sample. I'm pretty clear on using Adapters to pass types that are not in VSTA proxy. Not clear on how to mix a proxied type with a custom adapter type. In this sample,I’ll start simply by passing the current Document as IElement through custom adapter...
-
To avoid losing an event hook-up from a COM source it is necessary to hold a local reference to the source of the event to avoid unwanted garbage collection. This is a concern for VSTA hosts hooking into DTE events as well as VSTA add-ins which use a direct reference to a COM host instead of a proxy...
-
With VSTA v 2 it is possible to use generic parameters of intrinsic types with minimal effort. The example below demonstrates this with a method added to the ShapeApp.Application class which accepts a List<string>. Steps: 1) Create the proxy file ignoring the ProxyGen warnings: ProxyGen.exe Warning...
-
In the proxy file, all types and non-static members in non-classEntryPoint types are marked with a host attribute. The host attributes HostTypeAttribute and HostMemberAttribute are used to reconcile name changes. When there is no name change the attribute is unnecessary. The VSTA runtime uses this attribute...