DDEINITIATE

Purpose:

Begins a DDE Conversation.

Syntax:

DDEINITIATE("app", "topic", "item", "server", autostart)

DDEINITIATE("app|topic!item", "server", autostart)

"app"

-

A string, the application name.

"topic"

-

Optional. A string, the topic name.

"item"

-

Optional. A string, the item name.

"server"

-

Optional. A string, the name of server executable.

autostart

-

Optional. An integer, start DDE server flag:

0:

Do not start server (default)

1:

Start DDE server

Returns:

A positive integer representing the channel number for subsequent DDE operations. If the DDE conversation cannot be established, a value of 0 is returned.

Example:

chan = ddeinit("Excel", "Sheet1")

dderequest(chan, "R1C1")

ddeterm(chan)

 

establishes a DDE conversation with Excel, returns the value of the cell in row 1, column 1 as a string and then terminates the conversation. To automatically start Excel if it is not already running, try:

 

chan = ddeinit("Excel, "Sheet1", "", "C:\excel\excel", 1)

Remarks:

The "app", optional "topic" and optional "item" strings can also be placed in one string of the following Syntax: "app|topic!item". For example:

 

chan = ddeinit("Excel|Sheet1")

 

The "Commands" and "System" topics are supported when acting as a DDE server. The "Commands" topic is for normal server interaction.

 

The "System" topic supports the following "items":

 

"SysItems"  - All items under the System topic.

"Topics"       - All topics.

"Formats"    - Supported Clipboard formats.

See Also:

DDEEXECUTE

DDELINK

DDETERMINATE