-
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...
-
Q : I have a problem with loading VB add-ins. The method call: ObjectModel::Collection<AddInToken^>^ addInToken = AddInStore::FindAddIn(IEntryPoint::typeid, AddInStoreExtensions::DefaultPipelinePath, FilePath, TypeName); returns an empty collection when called on a dll created using VB. The FilePath...
-
For chapter three, I will be introducing a framework from Microsoft called the Managed Extensibility Framework, or MEF ( MEF on CodePlex , MEF on MSDN ). If you are not familiar with MEF, you will certainly get more out of this post if you read the MEF overview and programming guide ( MEF Overview ,...
-
Here is the second chapter in my integration journey. If you have not looked at the first blog post , it would be a good idea to look there first, because that post will explain the application I am working with and my idea behind it. First, let’s look at a few things that have changed since my...
-
Q : Here is a question about VSTA multi threads. I have a function to create a new project file. It works fine when I just run the line of code in VSTA. But it failed when debugging. I looked into it and found no difference except for the executing thread. When I run the macro, the main thread calls...
-
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...
-
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...
-
There is a known issue with inheritance for COM apps in ProxyGen. The events are not inherited by the interface returned to the add-in and casting won’t fix this. The simple workaround is to add the missing inheritance to the proxy or to the descriptor file. We have a tool AutoProxyGen which accepts...
-
These are the steps to enable in-process debugging in ShapeAppMacroRecording sample’s VstaDesignTimeIntegration class: 1. private int currentProcessID; internal void Connect(Application hostApplication) { currentProcessID = System.Diagnostics.Process.GetCurrentProcess().Id; 2. int IExternalDebugHost...
-
Q : I have a couple of questions that I hope you can answer: 1) It seems that any time the VSTA documentation discusses running end-user-code, it refers to that user code as an “addin,” even if that code comes from a macro recording. Therefore, is it fair to say that all code that end-users...
-
Q : I have a couple of questions about version compatibility. 1) Will a compiled VSTA 2.0 add-in run in a VSTA 1.0 environment? 2) What about recompiling a VSTA 2.0 project in a 1.0 environment? Will this work? A : Due to the technical merit of VSTA’s runtime it was added to the .NET 3.5 framework...
-
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...
-
Explicitly Implemented Interfaces: It does not appear that using explicitly implemented interfaces will allow or make easier support for generics. VSTA does not support explicitly implemented generic interfaces such as IList<T>. Both entry point and non-entry point types may use explicitly implemented...
-
Gary did some work using Delphi COM a few years back -- he integrated VBA into a Delphi application. Here's an example of the tiny managed proxy, called ObjectModelAgent. -Host app calls SetOM with IDispatch* or IUnknown* parameter. -Addin calls GetOM -Proxy layer code for GetOM marshals the COM...
-
Using an independent COM component (VSTOEE90.dll), and some code auto-generated by the Office tools, the VBA programmer can easily call managed code in a VSTA add-in assembly. The complete code necessary is shown in this screenshot of the VBA IDE. Excel 2007 VBA calls a managed class in VSTA Add-in:...