home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / p4w_all.zip / TI1438.ASC < prev    next >
Text File  |  1993-04-27  |  13KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1438
  9.   VERSION  :  1.0
  10.        OS  :  WIN
  11.      DATE  :  April 27, 1993                           PAGE  :  1/6
  12.  
  13.     TITLE  :  An Introduction to DDE and OLE
  14.  
  15.  
  16.  
  17.  
  18.   Intended Audience
  19.   This document is for users who have little or no experience in
  20.   DDE and OLE linking.
  21.  
  22.   Prerequisites
  23.   You must have software that allows for linking on a Client and
  24.   Server basis.
  25.  
  26.   Purpose of the TI
  27.   This document will prepare you to create simple links using the
  28.   Windows Clipboard, and will give you an understanding of linking
  29.   requirements, terminology and command structure.  Also, it will
  30.   present an example to illustrate how Paradox for Windows is used
  31.   as a Client application (stores information from other
  32.   applications).  Using Paradox for Windows as a Server application
  33.   will not be covered here.  For answers to common questions about
  34.   DDE and OLE, refer to TI 1439.
  35.  
  36.  
  37.   Exchanging Data With DDE and OLE
  38.  
  39.   Paradox for Windows has many ways of exchanging data with other
  40.   applications.  Exchanging data means using a Windows function to
  41.   bring text, graphics, sound, or other information from one
  42.   application to another.  After reading this document, you will
  43.   have a good understanding of the options available that allow
  44.   combining and assembling data from other applications into one
  45.   central location: your Paradox for Windows Table.
  46.  
  47.   This document will address the following topics:
  48.  
  49.      1.  How do you bring part of a file (a picture from a paint or
  50.          a desktop publishing program, data from a database or
  51.          table, text from a document, cells from a spreadsheet, or
  52.          sound) from another Windows application into your Paradox
  53.          for Windows Table?
  54.  
  55.      2.  How do you modify objects in your Table that were created
  56.          by exchanging data from sources outside of Paradox for
  57.          Windows?
  58.  
  59.      3.  Will you see changes in these objects if you or someone
  60.          else modifies the original files?
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1438
  75.   VERSION  :  1.0
  76.        OS  :  WIN
  77.      DATE  :  April 27, 1993                           PAGE  :  2/6
  78.  
  79.     TITLE  :  An Introduction to DDE and OLE
  80.  
  81.  
  82.  
  83.  
  84.   The functions discussed here will include the copying and pasting
  85.   of static objects, linked objects, and embedded objects.  In this
  86.   document, the examples will use a word processing application as
  87.   an OLE (Object Linking and Embedding) and DDE (Dynamic Data
  88.   Exchange) server; the behavior of other OLE server applications
  89.   may be different.
  90.  
  91.   Copying a picture from one application and pasting it into
  92.   another, results in a static image or a static object in the
  93.   target application.
  94.  
  95.   A linked object has a pointer or reference to part of the
  96.   original source file and is capable of a dynamic exchange.  This
  97.   means, if you or someone else modifies the part of the file that
  98.   your object in Paradox for Windows is linked to, the object will
  99.   reflect the change either directly or indirectly.  This will be
  100.   illustrated in an example that follows.
  101.  
  102.   An embedded object is an object that is copied from the original
  103.   file and pasted into an OLE object or OLE field in a Paradox for
  104.   Windows file.  You become the owner of this pasted object and it
  105.   becomes a separate entity apart from the copied object in the
  106.   original file.  If the original file is altered, the object in
  107.   the Paradox for Windows file remains unaffected.  However, the
  108.   object in the Paradox for Windows document can only be altered by
  109.   the original application.  This is discussed in a following
  110.   example.
  111.  
  112.   The simplest way to illustrate how to bring text, pictures, or
  113.   sound into Paradox for Windows follows.  For this example to work
  114.   as expected:
  115.  
  116.       -  A DDE and an OLE server, such as Microsoft Word for
  117.          Windows 2.0 or AMI PRO 2.0 or 3.0, etc., is used.
  118.  
  119.       -  The application program must be installed from diskettes
  120.          (so that the Windows registration database is updated),
  121.          and must be in the DOS PATH and the PC rebooted if
  122.          necessary.
  123.  
  124.      1.  If you are unsure of your application's DDE and OLE
  125.          capabilities, run the application, open a saved document,
  126.          select some text, and choose Edit | Copy.  Then, leaving
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1438
  141.   VERSION  :  1.0
  142.        OS  :  WIN
  143.      DATE  :  April 27, 1993                           PAGE  :  3/6
  144.  
  145.     TITLE  :  An Introduction to DDE and OLE
  146.  
  147.  
  148.  
  149.  
  150.          the document open, switch to the Program Manager, and
  151.          double-click on the Clipboard icon in the MAIN program
  152.          group.  Select Display.  You should see Link, OwnerLink,
  153.          Native, and Picture.  Some of these will appear dimmed.
  154.  
  155.      2.  Create a Paradox for Windows table that has three fields;
  156.          an Alphanumeric (size 100) field, a Formatted Memo Field,
  157.          and an OLE field.  No minimum size is required for the
  158.          Formatted Memo Field or the OLE field.
  159.  
  160.   Two records will be used in this example; the first one for
  161.   static objects where you will paste into the Alphanumeric and
  162.   into the Formatted Memo fields, and the second record for a
  163.   dynamic link and an embed where you will paste link into the
  164.   Alphanumeric field and paste into the OLE field.
  165.  
  166.      1.  If your word processing application is not currently
  167.          running, run your application and open a saved document.
  168.          Select or reselect a few words of text (under 100
  169.          characters including spaces, no pictures, for this
  170.          example).
  171.  
  172.      2.  Choose Edit | Copy.  This copies your selection together
  173.          with the application's DDE and OLE information to the
  174.          Windows Clipboard (a temporary storage area).
  175.  
  176.      3.  Leave your document open and return to Paradox for
  177.          Windows.
  178.  
  179.      4.  Open the new table and press [F9] to edit.
  180.  
  181.      5.  Choose Edit | Paste.  This transfers a static image
  182.          (discussed in more detail below) of the text from the
  183.          Clipboard into the current field.
  184.  
  185.      6.  Tab once to the Formatted Memo Field.
  186.  
  187.      7.  Choose Table | Field View, then choose Edit | Paste.  This
  188.          also transfers a static image of the text from the
  189.          Clipboard into the current field.
  190.  
  191.      8.  Choose Table | Field View, then Tab twice to move to the
  192.          Alphanumeric field in the next record.
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1438
  207.   VERSION  :  1.0
  208.        OS  :  WIN
  209.      DATE  :  April 27, 1993                           PAGE  :  4/6
  210.  
  211.     TITLE  :  An Introduction to DDE and OLE
  212.  
  213.  
  214.  
  215.  
  216.      9.  Choose Edit | Paste Link.  This transfers the Link
  217.          information about your word processor application,
  218.          document, and the item from the Clipboard into the current
  219.          field.
  220.  
  221.     10.  Tab twice to the OLE field.
  222.  
  223.     11.  Choose Edit | Paste.  This transfers a picture presented
  224.          from the word processor together with information about
  225.          embedding it from the Clipboard into the current field.
  226.  
  227.   Now that the example table is set up, the next section of this
  228.   document will examine the different field objects and determine
  229.   how they might be used.
  230.  
  231.      1.  Move back to the first field in the previous record.  The
  232.          Alphanumeric and the Formatted Memo fields in this record
  233.          now contain static text objects.  You will see a copy of
  234.          the text from your word processor, but the font is
  235.          different.  This field accepts text from the Clipboard
  236.          (minus the font attributes of the text).  Also, it accepts
  237.          only as much text as will fit in the size field you
  238.          created (100 characters in this case).
  239.  
  240.          The text appears in the same font as the default font for
  241.          Paradox for Windows.  You can also change the font just
  242.          for that field (which affects all records in that field).
  243.  
  244.      2.  Tab to the Formatted memo field.  You should now see the
  245.          text in the same font as it appeared when copied from your
  246.          word processor.  If this field were a simple Memo field,
  247.          the text would appear the same as in the Alphanumeric
  248.          field.  However, you cannot change the font in a Memo
  249.          field (hence the use of the Formatted Memo field).  Again,
  250.          the text in these two fields of this record are static
  251.          objects.  They are part of your table and no longer have
  252.          any connection to the original document or word processor.
  253.  
  254.   The next section will discuss how Windows allows for dynamically
  255.   linking objects from different applications.
  256.  
  257.      1.  Move to the Alphanumeric field in the next record.  The
  258.          contents of this field look totally different from what
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1438
  273.   VERSION  :  1.0
  274.        OS  :  WIN
  275.      DATE  :  April 27, 1993                           PAGE  :  5/6
  276.  
  277.     TITLE  :  An Introduction to DDE and OLE
  278.  
  279.  
  280.  
  281.  
  282.          you might expect.  What appears is a DDE string that looks
  283.          like: @DDE:WinWord!C:\WINWORD\LINK.DOC!DDE_LINK1!@.  This
  284.          is the pointer to the text in the word processing
  285.          document.  The item at the end of the string (DDE_LINK1)
  286.          is also stored in the original document, invisibly.  It
  287.          points to the same block of text that was copied
  288.          originally.
  289.  
  290.      2.  Leave the table open and switch to your word processor.
  291.          Exit it and select "Yes" if it asks you to save changes.
  292.          The changes referred to are usually the link information
  293.          stored in the source document.  Now, you should be back to
  294.          the field with the DDE link.  Press [Shift+F2].  This
  295.          launches your word processor and what appears is the
  296.          entire document.  You would see a change if you or someone
  297.          else changed the block of text that was originally copied.
  298.          This illustrates how data from files in other applications
  299.          are linked dynamically.
  300.  
  301.   NOTE: Objects with Paradox for Windows can also dynamically link
  302.         to other objects within Paradox for Windows.  A good
  303.         example of this is presented in the section "Using DDE in
  304.         queries" in Chapter 15 of the User's Guide.
  305.  
  306.   The last Windows function to examine is OLE.  When you paste into
  307.   an OLE field, you embed that part of the document you copied in
  308.   the word processor.  This object ceases to have a connection to
  309.   the original document but can still be edited by the word
  310.   processor.
  311.  
  312.      1.  Exit the word processor and Tab twice to the OLE field.
  313.          The object rendered in the field will be either an icon of
  314.          the word processor or a graphic image of the text.  The
  315.          appearance of this object is determined by the word
  316.          processor (or another application type).  Usually OLE
  317.          capable word processors provide icons to the Clipboard as
  318.          a Picture when something is copied for the purpose of
  319.          being embedded.  Paint and spreadsheet programs provide
  320.          graphic images of the actual data.
  321.           
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1438
  339.   VERSION  :  1.0
  340.        OS  :  WIN
  341.      DATE  :  April 27, 1993                           PAGE  :  6/6
  342.  
  343.     TITLE  :  An Introduction to DDE and OLE
  344.  
  345.  
  346.  
  347.  
  348.      2.  Double-click on the field or press [Shift+F2].  Now you
  349.          see the word processor, but not the original document.
  350.          Only the text originally copied appears, and now you can
  351.          change it.  If you Save, Exit, and double-click again, you
  352.          will see your changes.
  353.  
  354.  
  355.   Suggested Reading:
  356.  
  357.   Microsoft Windows 3.1 Reading
  358.   Microsoft Windows 3.1 User's Guide              Chapter 13
  359.   Microsoft Windows 3.1 Resource Kit              Chapter 11
  360.   Microsoft Windows 3.1 Software Development Kit  Volume 1,
  361.                                                     Chapter 5 and 6
  362.    
  363.   Paradox for Windows Reading
  364.   User's Guide
  365.        Chapter 15
  366.   ObjectPAL Developer's Guide
  367.        Chapter 5, "Passing arguments"
  368.        Chapter 9, "OLE: Object Linking and Embedding"
  369.        Chapter 11, "DDE: Link to other applications"
  370.  
  371.   ObjectPAL Reference Manual
  372.        Chapter 3, "return"
  373.        Chapter 4, "AnyType", "view", "DDE", "OLE"
  374.        Chapter 5, "index"
  375.  
  376.   TI 1439, "Answers to Common Questions About DDE and OLE"
  377.  
  378.  
  379.  
  380.   DISCLAIMER: You have the right to use this technical information
  381.   subject to the terms of the No-Nonsense License Statement that
  382.   you received with the Borland product to which this information
  383.   pertains.
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.