Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - // fivewin ddeml class tddemlserver demonstration http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
// FiveWin DDEML Class TDDEMLServer demonstration

#include "FiveWin.ch"

extern DbUseArea, DbGoTop, DbSkip, DbGoBottom

static oWnd, oServer

//----------------------------------------------------------------------------//

function Main()

   USE c:\FiveWin.19\samples\Customer

   DEFINE WINDOW oWnd TITLE "DDEML Server"

   ACTIVATE WINDOW oWnd ;
      ON INIT InitServer()

   oServer:End()   // Destroyes the DDEML Server

return nil

//----------------------------------------------------------------------------//

function InitServer()

   if oServer == nil
      oServer = TDDEMLServer():New()

      // Enable the application as a remote NetDDE server !!!
      oServer:SetNetDDE( .t. )

      oServer:bOnConnect = { || oWnd:Say( 3, 0, "Connected!" ) }

      oServer:bOnExecute = { | cCommand | ;
                           MsgInfo( "Command: " + cCommand,;
                                    "Server: Command Received" ) }

      oServer:bOnRequest = { | cRequest, cTopic | ;
                             RequestData( cRequest ) }

      oServer:bOnDisconnect = { || MsgInfo( "The client has disconnected!" ) }


   endif

return nil

//----------------------------------------------------------------------------//

function RequestData( cRequest )

   local cResult := &( cRequest )    // Clipper powerfull macros... <g>

return oServer:Return( cResult )

//----------------------------------------------------------------------------//

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson