DDE

From The Foundry MODO SDK wiki
Jump to: navigation, search

DDE stands for Dynamic Data Exchange, an older Microsoft protocol for inter-process communication. This is a Windows-specific feature.

One of the most common uses of DDE is to open a file double-clicked on in Windows Explorer in a currently running instance of an application. Indeed, this is why it was implemented in modo in the first place. But DDE also allows for more arbitrary functionality.

DDE in modo

modo's implementation of DDE allows other applications to send it commands to be executed. Only executions are allowed; queries are not supported.

Connecting

Connecting (aka "starting a conversation") through DDE is done by specifying the name of the application (server) and the topic targeted. For modo, the application name is modo and the topic is system.

Supported Execution Requests

Clients can ask modo to open a file or execute an arbitrary command. The request name may be optionally wrapped in square braces, as per the DDE specification.

nop

A no-op. This does nothing, and is implemented for completeness.

open("<filename>")

Open a scene file into modo. This was implemented primarily for Windows Explorer. The parentheses and quotes wrapping the filename are required.

cmd <command and arguments>

Execute the command string provided. Note that this transaction type identifier is four characters: 'c', 'm', 'd', and ' '. Everything after the space is considered a command string and is sent directly to the command system for executing.

User Idle and Errors

Although connections and disconnections are allowed at any time, executing other requests will only work when the user is idle. "Idle" is defined as no modal dialogs are open, no mouse buttons or keys are down, and no commands are currently executing. If the user is not idle, DDE_FBUSY is returned to suggest that you should try again later.

If the data exceeds the available buffer size, DDE_FNOTPROCESSED is returned. The buffer is currently set to 2K. This error is also used to indicate an unrecognized request.

If everything went well, DDE_FACK is returned.

More Information