Browse Blog Posts by Tags
-
Q : What do you know about this error? It happens sometimes after clicking “Start Debuging” triangle button on VSTA IDE window. A : Add InitializeLifetimeService() method to the class that implements IExternalDebugHost as shown below. == ShapeAppMacroRecordingCSharp sample should add InitializeLifetimeService...
-
Because C# does not provide a dllexport equivalent, you'll need to add a CPP shim into the mix that can get an instance of the managed class from the CLR. Here's the quick walkthrough: 1. Add a cpp library to the VSTA integration solution 2. Reference the VSTA Integration assembly from the cpp...
-
Here's some sample C# code showing how to intercept DTE commands. _dispCommandEvents_BeforeExecuteEventHandler has a parameter that allows you to cancel execution of the command if that is what you want to do. private EnvDTE. CommandEvents mCommandNewProject; // set up events for IDE commands cmd...
-
Q : How do I migrate my VB template to C#? Do you have sort of a template for making a template? I'm using VSTA version 1. A : The best thing to do would be to take a look at the ShapeAppCSharp sample templates included with the SDK. You can base your templates off these. The vstemplate and xxproj...
-
Please try this C++/COM/C# sample for VSTA 2.0 on how to: --load/unload different macro addins/projects --'show macros' whether the assembly is loaded in memory or not (ReflectionOnly). Sample demonstrates: 1. 'Load VCF' loading and unloading macro addins and their projects from a single...
-
VB and C# hook into events very differently. A VB template can use “ Handles Me .Startup” and “ Handles Me .Shutdown” in the AppAddIn.vb file to hookup the events. C# requires this code to be explicitly executed, so you’ll need to add some hookup code. This is done in the...
-
Q : I'm having trouble actually creating a new add-in project using the template. I have the several files that make up the template. I took the .vstemplate file from the VB version and edited it to match the file names of the C# edition. I stuck all the files into a zip file. I ran "vsta /hostid...
-
If you are shipping interop assemblies or PIAs of COM type libraries, you may have some elements in your type library marked as hidden. But, C# and VB Intellisense show these hidden elements anyway. This problem can be fixed with some low level work. This information may help you with the task. To create...