Exchange data between Visual FoxPro and other Microsoft Windows-based applications.
Visual FoxPro can act as both a server and a client to send and receive data to and from other Microsoft Windows-based applications.
The following naming conventions are used in applications that support DDE (dynamic data exchange).
A name that the server responds to when a client tries to access the server. A server can support many service names.
A name that specifies a logical set of data. For file-based applications, topic names are usually file names. In other applications, topic names are application-specific. To access the server, the client must specify a topic name in addition to the server's service name.
A name that specifies a unit of data that the server can pass to the client requesting the data.
To request data from another application, create a Visual FoxPro program that establishes Visual FoxPro as a client. The following is a brief outline for creating a simple Visual FoxPro program that requests data from another application:
Establish a link to the server application with DDEInitiate(В ).
If the link is successfully established, use DDERequest(В ) to request data from the server application. DDERequest(В ) can be issued repeatedly to request additional data.
After the data has been received, issue DDETerminate(В ) to terminate the link to the server application to free up system resources.
The functions above establish a cold link. A cold link exists when the client initiates all the communications between the applications. For a discussion of other types of links, see DDEAdvise(В ).
The following is a brief outline for a program that establishes Visual FoxPro as a server:
Use DDESetService(В ) to create a service and specify the type of service.
Use DDESetTopic(В ) to create a service topic and specify the procedure to execute when the topic is specified in a client request.
Create the procedure specified in DDESetTopic(В ) to accept the parameters passed to the procedure.
Within the procedure, process the request and, if appropriate, return the requested data to the client.
Note that these DDE functions differ from previous Visual FoxPro function conventions in the following ways:
The first four characters of these functions are not unique.
The function names exceed 10 characters and cannot be abbreviated.
DDE Function Description
Ends an asynchronous DDE transaction.
Creates a notify link or an automatic link used in DDE.
Enables or disables DDE processing or returns the status of DDE processing.
Using DDE, sends a command to another application.
Establishes a DDE channel between Visual FoxPro and another Microsoft Windows-based application.
Returns an error number for the last DDE function.
Sends data between client and server applications in a DDE conversation.
Requests data from a server application in a dynamic DDE conversation.
Changes or returns DDE settings.
Creates, releases, or modifies service names and settings in Visual FoxPro.
In a DDE conversation, creates or releases a topic name from a service name.
Closes a DDE channel established with DDEInitiate(В ).
Other ResourcesDDEAbortTrans( ) Function
DDEAdvise( ) Function
DDEEnabled( ) Function
DDEExecute( ) Function
DDEInitiate(В ) Function
DDELastError(В ) Function
DDEPoke(В ) Function
DDERequest( ) Function
DDESetOption( ) Function
DDESetService( ) Function
DDESetTopic( ) Function
DDETerminate( ) Function