How to override IOleCommandTarget.Exec() function

Hi All,

I am writng a VSPackage using c# for Visual Studio 2005.

I used the extensibility wizard to start creating my VSPackage. My VSPackage extends the Package class.

I am in a need to intercept the Exec() function which the Package class implements by implementing the interface IOleCommandTarget. Unfourtunately this function is not virtual. I had a similar problem in overriding QueryStatus() function.

Is there any help anyone can point to

Any help would be so much appreciated.

Regards




Answer this question

How to override IOleCommandTarget.Exec() function

  • Latesh Patel

    You can implement the IOleCommandTarget anyway like this

    public class YourPackageClass : MSVSIP.Package, IOleCommandTarget

    {

    // Implement Exec and QueryStatus

    }



  • Harris Sayed

    Thanks, that seems to work.



  • How to override IOleCommandTarget.Exec() function