JavaScript Editor js editor     Web development 

Main Page

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).

Name Description

Service Name

A name that the server responds to when a client tries to access the server. A server can support many service names.

Topic Name

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.

Item 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

    DDEAbortTrans(В )

    Ends an asynchronous DDE transaction.

    DDEAdvise(В )

    Creates a notify link or an automatic link used in DDE.

    DDEEnabled(В )

    Enables or disables DDE processing or returns the status of DDE processing.

    DDEExecute(В )

    Using DDE, sends a command to another application.

    DDEInitiate(В )

    Establishes a DDE channel between Visual FoxPro and another Microsoft Windows-based application.

    DDELastError(В )

    Returns an error number for the last DDE function.

    DDEPoke(В )

    Sends data between client and server applications in a DDE conversation.

    DDERequest(В )

    Requests data from a server application in a dynamic DDE conversation.

    DDESetOption(В )

    Changes or returns DDE settings.

    DDESetService(В )

    Creates, releases, or modifies service names and settings in Visual FoxPro.

    DDESetTopic(В )

    In a DDE conversation, creates or releases a topic name from a service name.

    DDETerminate(В )

    Closes a DDE channel established with DDEInitiate(В ).

See Also

JavaScript Editor js editor     Web development