Collapse the table of content
Expand the table of content

EXT_COMMAND function

The EXT_COMMAND macro is used to define an extension command that was declared by using the EXT_COMMAND_METHOD macro.

An extension command is defined as follows:





The name of the extension command. This must be the same as the _Name parameter that is used to declare the extension command by using EXT_COMMAND_METHOD.

Because EXT_COMMAND is a macro, _Name must be the bare name of the extension command and should not be enclosed in quotation marks or be a variable.


A string describing the extension command.


A string describing the arguments that are expected by the extension command. For information about how the _Args string is formatted, see Parsing Extension Arguments.

Note   As an alternative to supplying a string that describes the arguments, you can use the string "{{custom}}" to indicate that the extension command will parse the arguments itself. The method GetRawArgStr can be used to fetch the raw argument for parsing.


The body of the extension command does not take any arguments. However, because the extension command is declared as a method of the EXT_CLASS class, it has access to all the members of the ExtExtension base class, some of which are initialized for the execution of the extension command.

The macro EXT_COMMAND_METHOD should be used to declare the extension command. As with all C++ declarations, the EXT_COMMAND_METHOD declaration should appear in the source files before the EXT_COMMAND definition.

When the debugger engine calls an extension command method, it wraps the call in a try / except block. This protects the engine from some types of bugs in the extension code; but, since the extension calls are executed in the same thread as the engine, they can still cause it to crash.

This macro also creates a function called _Name (which calls the method defined by the macro). In order for the engine to call the extension, this function must be exported from the extension library DLL.


Target platform


Engextcpp.h (include Engextcpp.hpp)

See also




Send comments about this topic to Microsoft

© 2016 Microsoft