BALLSRV: DDEML Server Demonstrates DDEML with Bouncing Ball
BALLSRV is a companion program for the BALLCLI sample application.
BALLSRV and BALLCLI demonstrate the basic concepts of the dynamic data exchange management library (DDEML) protocol and the correct method for implementing DDEML in an application. Although DDEML is a new concept in Microsoft(R) Windows(TM) version 3.1, a DDEML application will run without problems in Windows version 3.0 if the DDEML.DLL file is added to the Windows version 3.0 installation. An application that uses DDEML for DDE can establish a conversation with an application using the Windows version 3.0 DDE convention.
BALLSRV and BALLCLI demonstrate DDE by creating a ball and bouncing it between the server application window and the client application window. BALLSRV creates a purple ball and bounces it into the BALLCLI window. BALLCLI creates a green ball and bounces it into the BALLSRV window. In this configuration, each application acts as the server for the ball it creates and the client for the other ball.
BALLSRV acts as server when the purple ball reaches the right edge of its window. At this point, BALLSRV advises BALLCLI that the purple ball will bounce into its window. (The applications assume that the BALLSRV window is always on the left and the BALLCLI window is always on the right.) Similarly, BALLCLI acts as server when the green ball reaches the left edge of its window. At this point, BALLCLI advises BALLSRV that the green ball will bounce into its window. In each case, the application that receives data acts as the client.
BALLCLI and BALLSRV also let the user change the speed at which the ball bounces. The Speed option on the BALLSRV window changes the speed of the purple ball, and the Speed option on the BALLCLI window changes the speed of the green ball. Whenever the user changes the speed of a ball, the window containing the ball is notified through a DDEML transaction. In the same manner, when the size of one window changes, the size of the other window changes as well.
BALLSRV was built and tested under Microsoft Windows version 3.1.
KEYWORDS: DdeClientTransaction; DdeConnect; DdeCreateStringHandle; DdeDisconnect; DdeFreeStringHandle; DdeInitialize; DdeNameService; DdePostAdvise; DdeUninitialize; XTYP_ADVDATA; XTYP_ADVREQ; XTYP_ADVSTART; XTYP_ADVSTOP; XTYP_CONNECT; XTYP_CONNECT_CONFIRM; XTYP_DISCONNECT; AppendMenu; BitBlt; CheckMenuItem; CreateCompatibleDC; DeleteObject; FindWindow; GetDlgItemText; GetSystemMenu; GetWindowRect; LoadBitmap; LoadIcon;LoadString;PatBlt;SelectObject; SetDlgItemText;SetWindowPos;StretchBlt; WM_GETMINMAXINFO;WM_MOVE; WM_QUERYDRAGICON; WM_SIZE; WM_SYSCOMMAND; WM_TIMER;
{ewc navigate.dll, ewbutton, /Bcodeview /T"Click to open or copy files in the ballsrv project." /C"samples}