Debugging Tools for Windows

SetTextReplacement

The SetTextReplacement and SetTextReplacementWide methods set the value of a user-named alias.

HRESULT
  IDebugControl2::SetTextReplacement(
    IN PCSTR  SrcText,
    IN OPTIONAL PCSTR  DstText
    );

HRESULT
  IDebugControl4::SetTextReplacementWide(
    IN PCWSTR  SrcText,
    IN OPTIONAL PCSTR  DstText
    );

#ifdef UNICODE
#define SetTextReplacementT SetTextReplacementWide
#else
#define SetTextReplacementT SetTextReplacement
#endif

Parameters

SrcText
Specifies the name of the user-named alias. The debugger engine makes a copy of this string. If SrcText is the same as the name of an automatic alias, the automatic alias is hidden by the new user-named alias.
DstText
Specifies the value of the user-named alias. The debugger engine makes a copy of this string. If DstText is NULL, the user-named alias is removed.

Return Value

S_OK
The method was successful.

This method may also return error values. See Return Values for more details.

Interface Version

SetTextReplacement is available in IDebugControl2 and later versions. SetTextReplacementWide is available in IDebugControl4 and later versions.

Comments

Before executing commands or evaluating expressions, the debugger engine will replace the alias specified by SrcText with the value of the alias (specified by DstText).

If SrcText is an asterisk (*) and DstText is NULL, all user-named aliases are removed. This is the same behavior as the RemoveTextReplacements method.

When an alias is changed by this method, the event callbacks are notified by passing the DEBUG_CES_TEXT_REPLACEMENTS flag to the IDebugEventCallbacks::ChangeEngineState callback method.

For an overview of aliases used by the debugger engine, see Using Aliases. For more information about using aliases with the debugger engine API, see Interacting with the Engine.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetTextReplacement, RemoveTextReplacements, OutputTextReplacements, SetTextMacro, as, aS (Set Alias), ad (Delete Alias)

Build machine: CAPEBUILD