COM Shim Wizards v2
Today we release v2 of the COM Shim Wizards. These are updated versions of the wizards we released in 2004 for Visual Studio 2003. The new wizards work with Visual Studio 2005.
There's a covering article here:
You can download the wizards here:
These wizards allow you to build unmanaged shims for managed Office extensions, including shared add-ins, smart tags and realtime data servers. The wizards will ask you a few simple questions and then generate all the code for the shim, so that you only have to build the shim - you don't have to write any code.
The reasons why you should use a shim for managed Office add-ins and other extensions are detailed in the article, but essentially they increase robustness by isolating each extension in a separate appdomain. Of course, this functionality is one of the main advantages of using VSTO add-ins over shared add-ins, and is built into the VSTO runtime. Unfortunately, VSTO 2005 provided add-in support only for Outlook 2003. So if you're targeting any other Office 2003 application, or any earlier version of Office, you had no choice but to use shared add-ins.
The v2 wizards are basically the same as the v1 wizards, although we did take the opportunity to fix a bug and streamline the UI. The only significant difference is that the v2 shims support unloading of the target assemblies.
Until VSTO add-ins provide support for a wider range of Office applications (which it will in the upcoming releases), you are encouraged to provide shims for your add-ins, and these wizards do cover off this requirement quite nicely.
Comments
- Anonymous
July 25, 2006
Hi Friends,
I executed the articles steps, but when I build the wizardShimProject, my shared addin (that was working fine without shim) crashes. Is there something else to do than install the shared addin (from the SetupProject(without shim)) and build the wizardShimProject?
Images about the solution are there: http://www.cin.ufpe.br/~gbs2/shim
Thanks,
Guilherme - Anonymous
July 25, 2006
The COM Shim Wizards generate shims for a range of different Office extension types, including COM add-ins and smart tags. They do not generate shims for automation add-ins. It seems from your screenshots that you are trying to build an automation add-in. See my blog posts here for details on how to extend the COM shim to support automation add-ins:
http://blogs.officezealot.com/whitechapel/archive/2005/06/09/4756.aspx
http://blogs.officezealot.com/whitechapel/archive/2005/05/21/4728.aspx
From your registry screenshot, it seems that you're only registering the add-in as a COM add-in. You're not registering as an automation add-in. See here for details of how to fix that:
http://blogs.officezealot.com/whitechapel/archive/2005/01/29/4005.aspx
Also, of course, you should be registering the shim, not the managed assembly.
Also, you don't say what you're putting in your setup project. If you're building and registering a shim, then the shim needs to go into the setup project.
Finally, you need to provide more specific details of the "crash" you're experiencing. Even though you are not registering anything correctly, this should not result in a crash - it should merely result in the add-in and/or shim failing to load. Have you debugged your solution? Where is the crash happening? What's on the stack at the time of the crash? - Anonymous
September 14, 2006
Shims created for Excel 2002 (XP) does not work, RTD shims for Excel 2003 works fine though.
I have VS2005 and COM Shim Wizard v2 and Office XP installed, and after debugging the shim the row that seems to fail is in the CLRLoader.cpp:
IfFailGo( m_pHost->CreateDomainSetup(&pDomainSetupPunk) );
The HRESULT is something like "The process terminated unexpectedly"
I also verified that the supplied demo RTD server is sufering from the same issue, so it is no just my own RTD server that fails. The managed DLL's are working fine, i.e. without the shim.
Have you verified the RTD shim on different Office versions? - Anonymous
October 26, 2006
Under Outlook, we ran into issues with another application having loaded the CLR (perhaps via mscoree.dll, but who knows), but not having started the CLR. I changed the LoadCLR method in "CLRLoader.cpp" to invoke the Start() method on m_pHost ICorRuntimeHost object, even when the CorBindToRuntimeEx method returns S_FALSE. I believe that this would be because the other shim (or mscoree) did not explicitly invoke Start(). Not knowing the details of how Outlook loads the add-ins and Connects to them, it might be best to invoke Start(). When the CLR has not been Started, CreateDomainSetup fails in the CreateLocalAppDomain method.Any thought given to using the new Hosting Interfaces, ie. ICLRRuntimeHost instead of ICorRuntimeHost? - Anonymous
March 28, 2007
Introduction On November 2006, Microsoft released Visual Studio 2005 Tools for the 2007 Office System, - Anonymous
December 10, 2008
<a href= http://index1.ideasor.com >they shall not pass</a> <a href= http://index2.ideasor.com >cartoons weed pics</a> <a href= http://index3.ideasor.com >ecuador escorts and threesomes</a> <a href= http://index4.ideasor.com >illinois i-pass</a>