How to Perform DDE with DDEDATA.APPLast reviewed: April 30, 1996Article ID: Q112047 |
The information in this article applies to:
SUMMARYFoxPro for Windows can be both a dynamic data exchange (DDE) server and a DDE client. FoxPro for Windows ships with DDEDATA.PJX and all the source code. Using this application, and two instances of FoxPro for Windows, one as the client and one as the server, it is easy to demonstrate the value of DDE, as shown below.
MORE INFORMATIONNOTE: This article assumes that your machine has sufficient memory to run two instances of FoxPro for Windows.
Additional features can be added to DDEDATA.APP. In order to do this, you must modify DDEDATA.PRG and then rebuild the application. This application simply institutes a large DO CASE statement in order to respond to different DDE messages. For example, even though DDEDATA.APP enables the DDEExecute service, it doesn't do anything with it. However, if you added
Case sAction = "EXECUTE" &sDataas part of the DO CASE statement in the cbDataTopic, then when you typed
m.confirm = ddeexecute(m.chan,"wait window 'Hello'")the instance of FoxPro running DDEDATA.APP would display a wait window with the text "Hello". NOTE: The variable m.confirm again reveals if the command succeeded or failed. The "&sData" line is simply using macro substitution. The contents of sData are interpreted by FoxPro as if they had been typed in the Command window. DDEDATA.APP can be modified to accept and respond to many more requests. It is simply a matter of changing the DO CASE statement to accommodate these new items.
REFERENCES"Developer's Guide," version 2.5, Chapter 12 "Language Reference," version 2.5, pages L3-371, L3-363, L3-366,L3-369, L3-382
|
Additional reference words: FoxWin 2.50 2.50a 2.50b DDEData
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |