|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDDECommandHandler
Provides access to members that handle DDE commands.
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.
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.
Method Summary | |
---|---|
boolean |
canExecute(String command)
Indicates if the DDE command can be executed. |
void |
execute(String command)
Executes the DDE command. |
Method Detail |
---|
boolean canExecute(String command) throws IOException, AutomationException
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.
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))
command
- The command (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void execute(String command) throws IOException, AutomationException
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.
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))
command
- The command (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |