locked
Can I create my own instance of an IVsFindHelper? RRS feed

  • Question

  • I am trying to get a new instance of a class that implements the IVsFindHelper interface, preferably the object passed into the Find method of the IVsFindTarget interface.  Is it possible to do this?
    Thursday, May 6, 2010 10:47 PM

Answers

  • Hi Jeffrey,

    After consulting with other colleague, it's no problem to create a IVsFindHelper with CreateInstance in a VSPackage, please see following link:

    Guid finderIID = typeof(IVsFindHelper).GUID;
    Guid finderCLSID = typeof(VsFinderClass).GUID;
          
    IVsFindHelper findHelper = (IVsFindHelper) CreateInstance(ref finderCLSID, ref finderIID, typeof(IVsFindHelper));
    

    Please let me know if you have any questions.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Jeffrey Ruff Thursday, May 13, 2010 11:44 PM
    Thursday, May 13, 2010 2:51 AM

All replies

  • Hi Jeffrey,

    See you again.

    May I ask you why do you want to create your own instance of an IVsFindHelper? Based on my understanding, you don't need to create a new instance of an IVsFindHelper in IVsFindTarget interface.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, May 7, 2010 8:13 AM
  • We are not using the IVsFindTarget interface in this case, but we would like to utilize the FindHelper for regular expression support.
    Friday, May 7, 2010 3:34 PM
  • Hi Jeffrey,

    Have you tried it? And what issue do you get when you create a new instance of IVsFindHelper?

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, May 10, 2010 3:04 AM
  • The problem is I cannot create my own instance of the Visual Studio object that implements IVsFindHelper.  I do not know what guids and such to use for ILocalRegistry2.CreateInstance for example.
    Monday, May 10, 2010 10:49 PM
  • Hi Jeffrey,

    After consulting with other colleague, it's no problem to create a IVsFindHelper with CreateInstance in a VSPackage, please see following link:

    Guid finderIID = typeof(IVsFindHelper).GUID;
    Guid finderCLSID = typeof(VsFinderClass).GUID;
          
    IVsFindHelper findHelper = (IVsFindHelper) CreateInstance(ref finderCLSID, ref finderIID, typeof(IVsFindHelper));
    

    Please let me know if you have any questions.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Jeffrey Ruff Thursday, May 13, 2010 11:44 PM
    Thursday, May 13, 2010 2:51 AM