Share via


Debugger2.HexDisplayMode Property

Gets or sets a value indicating whether the expressions are output in hexadecimal or decimal format.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Syntax

'Declaration
Property HexDisplayMode As Boolean
bool HexDisplayMode { get; set; }
property bool HexDisplayMode {
    bool get ();
    void set (bool value);
}
abstract HexDisplayMode : bool with get, set
function get HexDisplayMode () : boolean 
function set HexDisplayMode (value : boolean)

Property Value

Type: Boolean
A Boolean that is true if hexadecimal format; otherwise, false.

Remarks

Use this property to determine or set whether expressions are output in hexadecimal or decimal format. It directly corresponds to the setting in the General, Debugging, Options dialog box.

See Expressions in the Debugger for more information.

Examples

The following example demonstrates how to use the HexDisplayMode property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Run the target application in the debug mode.

  3. When the application stops at the breakpoint, run the add-in.

public static void HexDisplayMode(EnvDTE80.DTE2 dte)
{
    // Setup debug Output window.
    Window w = 
    (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Hex Display Mode 
    Test");
    owp.Activate();

    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;
    debugger.HexDisplayMode = false;
    EnvDTE.Expression exp = debugger.GetExpression("length", true, 1);
    owp.OutputString("Value of variable length in decimal: " + 
    exp.Value);

    debugger.HexDisplayMode = true;
    exp = debugger.GetExpression("length", true, 1);
    owp.OutputString("\nValue of variable length in hex: " + 
    exp.Value);
}
Sub ShowEAX()
    Dim ow As OutputWindow
    ow = DTE2.Windows.Item(Constants.vsWindowKindOutput).Object
    Dim exp As Expression

    DTE2.Debugger.HexDisplayMode = False
    exp = DTE2.Debugger.GetExpression("eax")
    ow.ActivePane.OutputString(exp.Value + ", ")

    DTE2.Debugger.HexDisplayMode = True
    exp = DTE2.Debugger.GetExpression("eax")
    ow.ActivePane.OutputString(exp.Value + vbCrLf)
End Sub

.NET Framework Security

See Also

Reference

Debugger2 Interface

EnvDTE80 Namespace