StartServerDDE PowerScript function
Description
Establishes your application as a DDE server. You specify
the DDE name, topic, and items that you support.
Syntax
|
1 |
<span>StartServerDDE</span> ( { <span>windowname</span>, } <span>applname</span>, <span>topic</span> {, <span>item</span> } ) |
|
Argument |
Description |
|---|---|
|
windowname |
The name of the server window. The default |
|
applname |
The DDE name for your application. |
|
topic |
A string whose value is the basic data |
|
item |
A comma-separated list of one or more |
Return Values
Integer. Returns 1 if it succeeds. If
an error occurs, StartServerDDE returns -1, meaning
the your application is already started as a server. If any argument’s value
is null, StartServerDDE returns null.
Usage
When a DDE client application sends a DDE request, the request
includes one of the items you have declared that you support. You
determine how your application responds to each of those items.
A window must be open to provide a handle for the DDE conversation.
You cannot call StartServerDDE and other DDE
functions in an application object’s events.
When your application has established itself as a DDE server,
other applications can send DDE requests that trigger these events
in your application.
|
Client action |
Event triggered |
Functions available |
Purpose of function |
|---|---|---|---|
|
Sends a request for a hot link |
RemoteHotLinkStart |
— |
— |
|
Sends a command to your application |
RemoteExec |
GetCommandDDE GetCommandDDEOrigin |
Obtain the command Find out what client application sent the command |
|
Sends data |
RemoteSend |
GetDataDDE GetDataDDEOrigin |
Obtain the data Find out what client application sent the data |
|
Requests data from your server application |
RemoteRequest |
SetDataDDE RespondRemote |
Send the requested data Acknowledge the request |
|
Wants to terminate the hot link |
RemoteHotLinkStop |
— |
— |
Examples
This statement causes your PowerBuilder application
to begin acting as a server. It is known to other DDE applications
as MyPBApp; its topic is System, and
it supports items called Table1 and Table2:
|
1 |
<span>StartServerDDE</span>(w_emp, "MyPBApp","System", & |
|
1 |
"Table1", "Table2") |