AllenD's WebLog




Managed code and the IVsHierarchy interface in VS7.1 (Everett)

In the VSIP Everett Extras release (currently in beta - see http://www.vsipdev.com for more details) we've enabled managed code to more easily integrate into Visual Studio.  The problem is that there are some issues with VS's treatment of the IVsHierarchy interface that make managed implementations of the IVsHierarchy interfaces unusable.

The workaround to these issue is to write your IVsHierarchy implementation in native code.  The IVsHiearchy implementation is a thin wrapper that forwards all calls to your managed code.  The rest of your package can be managed also.  You'll need to handle the interop to get the native object created (using COM interop to treat the COM object as a .Net object), but that is all there is to it.  You can get quite far with a managed IVsHierarchy implementation, but eventually you'll find there are subtle problems with the Project Properties dialog and other issues that make your project not work at all.

So, avoid the problems altogether and stick with native code for your IVsHierarchy implementation.

In Whidbey, we plan for this to just go away.  As a matter of fact, in Whidbey we plan to make it easier than ever to create a custom project system in managed code.

Published Wednesday, February 11, 2004 2:51 PM by AllenD
Filed under: ,

Comments

 

ThoughtChain said:

February 13, 2004 5:59 AM
 

Ben Fidge said:

So it's perfectly OK to implement a COM based IVsHierarchy in say, Delphi, and then have that delegate calls from the IDE to a managed hierarchy class?

Do you have any examples of this in action?
March 17, 2004 7:29 AM
 

AllenD said:

I don't see why you couldn't, but I'm not familiar with Delphi to know what the issues might be. I'm sorry that don't have any samples of this.

Good luck.

Allen
March 17, 2004 8:29 AM
Anonymous comments are disabled

This Blog

Syndication

News

> These postings are provided "as-is" and confer no rights or warranties.


© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker