home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / WINDOWS / APPS / DDE_LIB.ZIP / DDEDEMOS.PRN < prev    next >
Encoding:
Text File  |  1990-09-17  |  6.3 KB  |  178 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                             Dynamic Data Exchange Demos
  9.  
  10.                              Horizon Technologies Inc.
  11.  
  12.             Overview:
  13.  
  14.             The Dynamic Data Exchange (DDE) demo programs illustrate the
  15.               concept of inter-program communications in a Microsoft
  16.               Windows environment.  Source code for three programs is
  17.               included.  All interactions between these programs are
  18.               accomplished via the process of message passing in
  19.               accordance with the DDE protocol defined by Microsoft.  A
  20.               dynamic link library, DDELIB, developed by Horizon
  21.               Technologies Inc., has been utilized in each of these
  22.               programs to significantly reduce development time and
  23.               program complexity.  The following material builds upon
  24.               the information presented in the Overview of the  DDELIB
  25.               documentation.
  26.  
  27.  
  28.             AccExcel:
  29.  
  30.  
  31.             ACCEXCEL is a menu driven application that shows the basics
  32.               of a DDE connection to EXCEL.  EXCEL is a popular Windows
  33.               spreadsheet application written by Microsoft.  The
  34.               ACCEXCEL pull-down menu "DDE" lists four items; Initiate,
  35.               Poke, Advise and Terminate.
  36.  
  37.             Initiate will establish a DDE session with a spreadsheet in
  38.               EXCEL.  The name of the spreadsheet is entered into a
  39.               dialog box presented by ACCEXCEL.  Poke will send data to
  40.               the spreadsheet.  A dialog box will allow the
  41.               specification of the cell range and the comma separated
  42.               data values.  Advise will set up an advise circuit with a
  43.               cell range in EXCEL.  When any data is modified in this
  44.               range, EXCEL will advise ACCEXCEL which in turn will
  45.               display a message box with the modified data.  Terminate
  46.               simply closes the DDE session established with Initiate.
  47.  
  48.  
  49.             Sub:
  50.  
  51.  
  52.             SUB is a DDE client application that talks to the server
  53.               application FISH.  FISH, supplied by Microsoft, displays
  54.               fish swimming in a tank.  When FISH establishes a session
  55.               with a client, it reveals a yellow submarine.  This
  56.               submarine can then be manipulated by the client to move
  57.               up, down, left, right and even fire a torpedo.  To
  58.  
  59.          DDE DEMOS - Copyright (C) September 12, 1990 Horizon
  60.          Technologies Inc.  All rights reserved.  (517) 347-0800    Page 1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.               augment this capability, the client can also obtain the
  67.               current position of a fish in x,y coordinates.  With a
  68.               simple sneak-up-from-behind-and-fire strategy, SUB easily
  69.               controls the submarine in a mission to liquidate fish.
  70.  
  71.             Technically, SUB initiates two sessions with fish;  one for
  72.               sub control and reporting, the other for fish position
  73.               monitoring.  A DDE advise circuit for fish number zero is
  74.               established.  The callback routine Fish() is called by
  75.               DDELIB every time the fish moves.  In this routine, a
  76.               request for the current sub position is made.  This
  77.               results in a callback to the Sub() routine.  Once the
  78.               current fish and sub positions are known, a call to
  79.               MoveSub() is made.  Here, a command is sent to the sub
  80.               for positioning and firing.  Note that the sub must be
  81.               moving up or down, left or right.  Therefore, if the sub
  82.               needs to maintain elevation, it must oscillate up and
  83.               down.
  84.  
  85.  
  86.             Session and SessUtil:
  87.  
  88.  
  89.             SESSION is a DDE server application that provides a means
  90.               for clients to store and retrieve string variable
  91.               contents by name.  SESSION accepts DDE pokes, requests,
  92.               and advises.  Commands are not supported.
  93.  
  94.             SESSION accomplishes this by registering the topic
  95.               Variables.  The callback routine Session() is invoked by
  96.               DDELIB every time a new client establishes a session,
  97.               terminates a session, pokes or requests data, establishes
  98.               an advise circuit, or sends a command.  SESSION processes
  99.               these events to provide its services, such as saving the
  100.               contents of a poke or advising a client of a change in
  101.               the variable.
  102.  
  103.             SESSUTIL is a DDE client application that communicates with
  104.               the SESSION application.  SESSUTIL shows the current
  105.               contents of the User variable, as provided by SESSION, on
  106.               its client area.  The user can set the contents of the
  107.               User variable by selecting the ______                                             Modify item from the ____                                                                  File
  108.               menu.  The new value is displayed on every instance of
  109.               SESSUTIL running.
  110.  
  111.             SESSUTIL initially establishes a DDE advise circuit with
  112.               SESSION on the variable User.  This causes the callback
  113.               routine User() to be invoked by DDELIB whenever SESSION
  114.               performs an advise.  User() will update its own copy of
  115.               the value and then force a repaint of the client area,
  116.               resulting in the new value of the User variable to be
  117.  
  118.          DDE DEMOS - Copyright (C) September 12, 1990 Horizon
  119.          Technologies Inc.  All rights reserved.  (517) 347-0800    Page 2
  120.  
  121.  
  122.  
  123.  
  124.  
  125.               displayed.  When the user selects OK from the modify
  126.               dialog box, the Poke() routine is called.  This sends the
  127.               new variable to SESSION, which in turn advises SESSUTIL,
  128.               which then displays the new value.
  129.  
  130.             Microsoft Word for Windows can eavesdrop in on the
  131.               conversation, displaying the current contents of the User
  132.               variable.  Simply insert a field of the form {ddeauto
  133.               SESSION Variables User}.
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.          DDE DEMOS - Copyright (C) September 12, 1990 Horizon
  178.          Technologies Inc.  All rights reserved.  (517) 347-0800    Page 3