User Tools

Site Tools


ddepoke_send_unsolicited_data_to_dde_server_.htm
Navigation:  Language Reference > App A - DDE, OLE, and OCX > DDE Procedures >====== DDEPOKE (send unsolicited data to DDE server) ====== Previous pageReturn to chapter overviewNext page

DDEPOKE( channel, item, value )

blk2blue.jpg

DDEPOKE Sends unsolicited data through an open DDE client channel to a DDE server.
channel A LONG integer constant or variable containing the client channel–the value returned by the DDECLIENT procedure.
item A string constant or variable containing the application-specific item to receive the unsolicited data.
value A string constant or variable containing the data to place in the item.

The DDEPOKE procedure allows a DDE client program to communicate unsolicited data to the server. The item and value parameters must be in a format the server application can recognize and act on. The server does not need to be a Clarion program.

A Clarion DDE server can use the DDEITEM() and DDEVALUE() procedures to determine what the client has sent. The CYCLE statement after an EVENT:DDEpoke signals positive acknowledgement to the client that sent the unsolicited data. DDEACKNOWLEDGE can send either positive or negative acknowledgement.

Errors Posted:

601 Invalid DDE Channel
602 DDE Channel Not Open
604 DDEPOKE Failed
605 Time Out

Events Generated:

EVENT:DDEpoke     A client has sent unsolicited data

Example:

WinOne  WINDOW,AT(0,0,160,400)

       END

DDEChannel  LONG

CODE

OPEN(WinOne)

DDEChannel = DDECLIENT('Excel','System')             !Open channel to Excel

DDEEXECUTE(DDEChannel,'[NEW(1)]')                    !Create a new spreadsheet

DDEEXECUTE(DDEChannel,'[Save.As(“DDE_CHART.XLS”)]')  !Save it as DDE_CHART.XLS

DDECLOSE(DDEChannel)                                 !Close conversation

DDEChannel = DDECLIENT('Excel','DDE_CHART.XLS')      !Open channel to new chart

DDEPOKE(DDEChannel,'R1C2','Widgets')                 !Send it data

DDEPOKE(DDEChannel,'R1C3','Gadgets')

DDEPOKE(DDEChannel,'R2C1','East')

DDEPOKE(DDEChannel,'R3C1','West')

DDEPOKE(DDEChannel,'R2C2','450')

DDEPOKE(DDEChannel,'R3C2','275')

DDEPOKE(DDEChannel,'R2C3','340')

DDEPOKE(DDEChannel,'R3C3','390')

DDEEXECUTE(DDEChannel,'[SELECT(“R1C1:R3C2”)]')       !Highlight the data

DDEEXECUTE(DDEChannel,'[NEW(2,2)]')                  !and create a new chart

   !Send some more commands here to format the chart and work with it

DDECLOSE(DDEChannel)                                 !Close channel when done

See Also:

DDEACKNOWLEDGE

DDEITEM

DDEVALUE

ddepoke_send_unsolicited_data_to_dde_server_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1