com.esri.arcgis.framework
Interface IDDECommandHandler

All Superinterfaces:
Serializable
All Known Implementing Classes:
GNetCommandHandler

public interface IDDECommandHandler
extends Serializable

Provides access to members that handle DDE commands.

Description

This interface uses it two members to handle incoming Dynamic Data Exchange (DDE) messages and to act upon these if required. The incoming message is passed to each of the members in turn in the form of an ANSI string.

When To Use

Inside ArcMap this interface is already used by the GNetCommandHandler CoClass, however of most importance to developers is the fact that they may implement the interface inside a class of their own. Such a class when registered in the "ESRI MX DDECommandHandlers" category will be given the opportunity, by ArcMap, to respond to any incoming DDE messages. This is done by sending the incoming message as a string, first to CanExecute and then if required to Execute. Typically the CanExecute function would check the incoming string and if suitable would return a value of TRUE thus causing ArcMap to call Execute where the appropriate action may be taken.

Product Availability

Available with ArcGIS Desktop.


Method Summary
 boolean canExecute(String command)
          Indicates if the DDE command can be executed.
 void execute(String command)
          Executes the DDE command.
 

Method Detail

canExecute

boolean canExecute(String command)
                   throws IOException,
                          AutomationException
Indicates if the DDE command can be executed.

Description

For any class which implements IDDECommandHandler and which is registered in the "ESRI MX DDECommandHandlers" category, ArcMap will call this function whenever a DDE message is received to check if the class can accept the incoming DDE Command string. Returning TRUE from this function will cause ArcMap to call the Execute procedure where any required operations may be carried out. Typically the CanExecute function will check that the incoming Command string is of the format expected by the Execute code.

Remarks

Depending upon the DDE Client involved the incoming Command string may need to be converted from ANSI to Unicode to be useful within the VB environment. Code such as the following can be used to do the conversion where StrCommUni is a string variable used to hold the unicode version of the Command string:

StrCommUni = StrConv(Command, vbUnicode))

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
command - The command (in)
Returns:
The canExecute
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

execute

void execute(String command)
             throws IOException,
                    AutomationException
Executes the DDE command.

Description

Execute may be used to respond to incoming DDE messages and carry out an appropriate task. For a class implementing IDDECommandHandler, ArcMap will only call Execute if the previous call to CanExecute returned TRUE.

Remarks

Depending upon the DDE Client involved the incoming Command string may need to be converted from ANSI to Unicode to be useful within the VB environment. Code such as the following can be used to do the conversion where StrCommUni is a string variable used to hold the unicode version of the Command string:

StrCommUni = StrConv(Command, vbUnicode))

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
command - The command (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.