GetDataDDEOrigin

Description

Determines the origin of data from a hot-linked DDE server application or a DDE client application, and if successful, stores the application’s DDE identifiers in the specified strings. PowerBuilder can use GetDataDDEOrigin when it is acting as a DDE client or as a DDE server application.

Syntax

GetDataDDEOrigin ( applstring, topicstring, itemstring )

Argument

Description

applstring

A string variable in which GetDataDDEOrigin will store the name of the server application

topicstring

A string variable in which GetDataDDEOrigin will store the topic (for example, in Microsoft Excel, the topic could be REGION.XLS)

itemstring

A string variable in which GetDataDDEOrigin will store the item identification (for example, in Microsoft Excel, the item could be R1C2)

Returns

Integer. Returns 1 if it succeeds and -1 if an error occurs (such as the function was called in the wrong context). If any argument’s value is null, GetDataDDEOrigin returns null.

Usage

Call GetDataDDEOrigin in the window-level script for a RemoteSend event or a HotLinkAlarm event.

When your application is a DDE server, call GetDataDDEOrigin in the script for the RemoteSend event. Use it to determine the topic and item requested by the client. The application name is the application specified by the client (the server’s own DDEname).

When your application is a DDE client, call GetDataDDEOrigin in the script for the HotLinkAlarm event. Use it to identify the source of the data when hot links may exist for more than one topic within the server application or for more than one application.

Examples

Example 1

This example illustrates how to call GetDataDDEOrigin:

string WhichAppl, WhatTopic, WhatLoc

GetDataDDEOrigin(WhichAppl, WhatTopic, WhatLoc)

See also