Partager via


IVsFindTarget.SetFindState, méthode

Détermine l'état d'une opération de recherche.

Espace de noms :  Microsoft.VisualStudio.TextManager.Interop
Assembly :  Microsoft.VisualStudio.TextManager.Interop (dans Microsoft.VisualStudio.TextManager.Interop.dll)

Syntaxe

'Déclaration
Function SetFindState ( _
    pUnk As Object _
) As Integer
int SetFindState(
    Object pUnk
)
int SetFindState(
    [InAttribute] Object^ pUnk
)
abstract SetFindState : 
        pUnk:Object -> int
function SetFindState(
    pUnk : Object
) : int

Paramètres

  • pUnk
    Type : Object

    [in]

Valeur de retour

Type : Int32
Si la méthode réussit, elle retourne S_OK.En cas d'échec, un code d'erreur est retourné.

Notes

Signature de COM

De textmgr.idl :

HRESULT IVsFindTarget::SetFindState(
   [in] IUnknown * punk
);

L'état de recherche est un objet opaque maintenu au nom du moteur de recherche. Une classe c++ dans Visual Studio peut utiliser un pointeur intelligent, ou utilisez code suivant pour gérer l'état de recherche.

Exemples

Une classe c++ dans VS l'utilisation de boîte un pointeur intelligent, ou utilisez code suivant pour gérer l'état de recherche

// Declare the following member

IUnknown * m_pUnkFindState;

// In constructor's member-initialization-list:

m_pUnkFindState(NULL)

// In destructor or ATL FinalRelease():

if (m_pUnkFindState)

{

m_pUnkFindState->Release();

m_pUnkFindState = NULL;

}

//

// method implementations

//

HRESULT MyClass::SetFindState (IUnknown * punk)

{

if (m_pUnkFindState)

{

m_pUnkFindState->Release();

m_pUnkFindState = NULL;

}

if (punk)

{

punk->AddRef();

m_pUnkFindState = punk;

}

return S_OK;

}

HRESULT MyClass::GetFindState (IUnknown **ppunk)

{

*ppunk = m_pUnkFindState;

if (m_pUnkFindState)

m_pUnkFindState->AddRef();

return S_OK;

}

Sécurité .NET Framework

Voir aussi

Référence

IVsFindTarget Interface

Microsoft.VisualStudio.TextManager.Interop, espace de noms