IVsFindTarget::Replace Method (String^, String^, UInt32, Int32, IVsFindHelper^, Int32)
Requests a text string replace.
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
int Replace( String^ pszSearch, String^ pszReplace, unsigned int grfOptions, int fResetStartPoint, IVsFindHelper^ pHelper, [OutAttribute] int% pfReplaced )
Parameters
- pszSearch
-
Type:
System::String^
[in] Pointer to a null terminated string containing the search text.
- pszReplace
-
Type:
System::String^
[in] Pointer to a null terminated string containing the replacement text.
- grfOptions
-
Type:
System::UInt32
[in] Specifies the search options. Values are taken from the __VSFINDOPTIONS enumeration.
- fResetStartPoint
-
Type:
System::Int32
[in] Flag to reset the search start point.
- pHelper
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsFindHelper^
[in] Pointer to a IVsFindHelper interface.
- pfReplaced
-
Type:
System::Int32
[out, retval] true if the replacement was successful.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Implement either GetSearchImage method or Find and Replace methods.
From textmgr.idl:
HRESULT IVsFindTarget::Replace( [in] LPCOLESTR pszSearch, [in] LPCOLESTR pszReplace, [in] VSFINDOPTIONS grfOptions, [in] BOOL fResetStartPoint, [in] IVsFindHelper * pHelper );
Find is called prior to Replace. When Replace is called, you should verify that the current selection string is equal to pszSearch, then replace the selection with pszReplace.