Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

OpenChannel – PB Docs 125 – PowerBuilder Library

OpenChannel – PB Docs 125

OpenChannel PowerScript function

Description

Opens a channel to a DDE server application.

Syntax

Argument

Description

applname

A string specifying the DDE name of the
DDE server application.

topicname

A string identifying the data or the
instance of the application you want to use (for example, in Microsoft
Excel, the topic name could be System or the name of an open spreadsheet).

windowhandle (optional)

The handle of the window that you want
to act as the DDE client. Specify this parameter to control which
window is acting as the DDE client when you have more than one open window.

Return Values

Long. Returns the handle to the channel
(a positive integer) if it succeeds. If an error occurs, OpenChannel returns
a negative integer. Values are:

  • -1 Open failed

  • -9 Handle is null

Usage

Use OpenChannel to open a channel to a
DDE server application and leave it open so you can efficiently
execute more than one DDE request. This type of DDE conversation
is called a warm link. Because you open a channel, the operating
system does not have to poll all open applications every time you send
or ask for data.

The following is an outline of a warm-link conversation:

  • Open a DDE channel
    with OpenChannel and check that it returns a
    valid channel handle (a positive value).

  • Execute several DDE functions. You can use the following
    functions:

  • Close the DDE channel with CloseChannel.

If you only need to use a remote DDE function once, you can
call ExecRemote, GetRemote,
or SetRemote without opening a channel. This
is called a cold link. Without an open channel, the operating system
polls all running applications to find the specified server application
each time you call a DDE function.

Your PowerBuilder application can also be a DDE server.

For more information, see StartServerDDE.

note.png About server applications

Each application decides how it supports DDE. You must check
each potential server application’s documentation to find
out its DDE name, what its valid topics are, and how it expects
locations to be specified.

Examples

These statements open a channel to the active spreadsheet REGION.XLS in Microsoft
Excel and set handle to the handle to the channel:

The following example opens a DDE channel to Excel
and requests data from three spreadsheet cells. In the PowerBuilder
application, the data is stored in the string array s_regiondata.
The client window for the DDE conversation is w_ddewin:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x