|
GetCommandList Method
|
|
|
Applies To
|
BasicTcl Object, AdvancedTcl Object
|
|
Prototype
|
GetCommandList(CommandList As Variant, Flags As Long, Reserved As Long) As Long
|
|
Input
|
The "CommandList" parameter, which must be empty.
The "Flags" parameter, which is reserved for future use and must be zero.
The "Reserved" parameter, which is reserved for future use and must be zero.
|
|
Output
|
The "CommandList" parameter is modified to contain the specified custom command list.
|
|
Returns
|
The number of custom commands in the list.
|
|
COM Results
|
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed or the "CommandList" parameter is not empty. E_OUTOFMEMORY: A string, variant, or array could not be allocated. |
|
Side Effects
|
None.
|
|
Description
|
The custom command list consists of a two-dimensional array of strings (zero based).
Each row contains information about one custom command.
Currently, there are eight elements in each row:
CommandList(row, 0) = Command Interpreter CommandList(row, 1) = Command Index (used internally, provided for reference only) CommandList(row, 2) = Command ID (used internally, provided for reference only) CommandList(row, 3) = User Provided clientData CommandList(row, 4) = Command Options (set via the SetCommandOptions method) CommandList(row, 5) = Command Name CommandList(row, 6) = Object Name (undefined unless the custom command was created with the CreateDynamicCommand method) CommandList(row, 7) = Method Name In the future, more columns may be added to each row. There will always be at least these eight columns. |
|
Notes
|
None.
|
|
Example
|
Private Sub Command1_Click()
Dim poTcl As TclBridge.BasicTcl Dim poClass As Class1 Dim plInterpreter As Long Dim pvCommandList As Variant Dim plCount As Long Set poTcl = New TclBridge.BasicTcl Set poClass = New Class1 Call poTcl.CreateInterpreter(plInterpreter) Call poTcl.CreateCommand(plInterpreter, "Tester1", poClass, "Test1", 1234&, 0&) pvCommandList = Empty ' must be empty plCount = poTcl.GetCommandList(pvCommandList, 0&, 0&) ' we should get 1 for plCount ' since we added only 1 command ' to the new object so far Call poTcl.DeleteCommand(plInterpreter, "Tester1") Call poTcl.DeleteInterpreter(plInterpreter) Set poClass = Nothing Set poTcl = Nothing End Sub |