Syntax 2: For DDE requests via an open channel
Description
Asks a DDE server application to provide data and stores that data
in the specified variable when you have already established a warm link
by opening a channel to the server. A warm link, with an open channel,
is more efficient when you intend to make several DDE requests.
Syntax
|
1 |
GetRemote ( location, target, handle {, windowhandle} {, bAnsi}) |
|
Argument |
Description |
|---|---|
|
location |
A string whose value is the location of the data you |
|
target |
A PowerBuilder string variable into which the returned |
|
handle |
A long that identifies the channel to the DDE server |
|
windowhandle (optional) |
The handle to the window that is acting as the DDE |
|
bAnsi (optional) |
A boolean identifying whether the string to get from the |
Return value
Integer.
Returns 1 if it succeeds and a negative integer if an error
occurs. Values are:
-1 — Link was not started
-2 — Request denied
-9 — Handle is null
Usage
When using DDE, your PowerBuilder application must have an open
window, which will be the client window. For this syntax, you can
specify the client window with the windowhandle argument.
Before using this syntax, call OpenChannel to establish a DDE
channel.
For more information about DDE channels and warm and cold links,
see the ExecRemote
function.
Examples
These statements ask the channel identified by handle (a Microsoft
Excel worksheet) to get the data in row 1 column 2 and save it in a
PowerBuilder string called ls_ProfData. GetRemote utilizes the warm link
established by the OpenChannel function:
|
1 2 3 4 5 6 7 8 |
String ls_ProfData long handle handle = OpenChannel("Excel", "REGION.XLS") ... GetRemote("R1C2", ls_ProfData, handle) ... CloseChannel(handle) |
The following example is similar to the previous one. However, it
specifically associates the DDE channel with the window w_rpt:
|
1 2 3 4 5 6 7 8 9 10 |
String ls_ProfData long handle handle = OpenChannel("Excel", "REGION.XLS", & Handle(w_rpt)) ... GetRemote("R1C2", ls_ProfData, & handle, Handle(w_rpt)) ... CloseChannel(handle, Handle(w_rpt)) |
See also