IVsTextImageUtilities::GetReplaceText Method (UInt32, String^, IVsTextImage^, array<TextSpan>^, IVsTextSpanSet^, String^)

 

Gets replace text for find/replace operations.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

int GetReplaceText(
	unsigned int grfOptions,
	String^ pszReplace,
	IVsTextImage^ pText,
	array<TextSpan>^ pMatch,
	IVsTextSpanSet^ pTags,
	[OutAttribute] String^% pbstrComputedText
)

Parameters

grfOptions
Type: System::UInt32

[in] Find options. Values are from the vsFindOptions enum.

pszReplace
Type: System::String^

[in] Replacement string.

pText
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextImage^

[in] Text image containing string to replace.

pMatch
Type: array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^

[in] The Find match.

pTags
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextSpanSet^

[in] Optional, set of text spans describing the Find match. Obtained by GetTaggedSpans.

pbstrComputedText
Type: System::String^

[out] The replace text string.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From textfind.idl:

HRESULT IVsTextImageUtilities::GetReplaceText(
   [in] VSFINDOPTIONS grfOptions,
   [in] LPCOLESTR pszReplace,
   [in] IVsTextImage * pText,
   [in] const TextSpan * pMatch,
   [in] IVsTextSpanSet * pTags,
   [out, retval] BSTR * pbstrComputedText
);

If you do not have a regex find/replace with tags, pTags can be null. If you have pTags, pMatch can be null.

Return to top
Show: