home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / info / dde_doc.txt < prev    next >
Text File  |  1993-04-05  |  22KB  |  335 lines

  1.                                                                                
  2.                DDE and Clipboard Exchange Between WIN-OS/2 and PM       4/2/93 
  3.                                                                                
  4.                ==================================================              
  5.  
  6.                                                                                
  7. Quick notes from the Boca Programming Center about DDE and clipboard           
  8. Exchange between PM and VDM's or between VDM's.                                
  9.                                                                                
  10. The implementation and configuration of DDE and Clipboard depends upon         
  11. which version of OS/2 is installed. Basically, there are two different         
  12. implementations of DDE and Clipboard, either GA (version 2.0) or post          
  13. GA (any RELEASE AFTER GA 2.0).                                                 
  14.  
  15.                                                                                
  16. DDE (DYNAMIC DATA EXCHANGE)                                                    
  17. ===========================                                                    
  18.  
  19.    Implementation                                                              
  20.    --------------                                                              
  21.  
  22.    In OS/2 2.x, all DDE communication between WIN-OS/2 and PM (or              
  23.    between separate WIN-OS/2 sessions) is handled by "agents".  These          
  24.    agents are responsible for the conversion of the DDE protocol and  
  25.    formats.  They must be running for DDE communication to take place 
  26.    between sessions.                                                  
  27.                                                                       
  28.    PUBLIC  - DDE messages are exported and imported between PM and    
  29.              WIN-OS/2 sessions.                                       
  30.                                                                       
  31.    PRIVATE - DDE messages are contained within the one session only.  
  32.              No data will be transferred out of or into the vdm.      
  33.  
  34.                                                                       
  35.    OS/2 2.0                                                           
  36.    --------                                                           
  37.  
  38.      The following are the names and locations of the agents needed   
  39.      to make DDE public:                                              
  40.                                                                       
  41.           c:\os2\pmdde.exe                   (PM DDE agent)           
  42.           c:\os2\mdos\winos2\ddeagent.exe    (WIN-OS/2 DDE agent)     
  43.           c:\os2\mdos\winos2\vdmserver.exe   (inter-vdm IPC handler)  
  44.                                                                       
  45.      In the c:\os2\mdos\winos2\system.ini, the following statements   
  46.      are required to start the WIN-OS/2 DDE Agent:                    
  47.                                                                       
  48.           SAVDMApps=!gopm,!clipwos2,!ddeagent                         
  49.           MAVDMApps=!gopm,!clipwos2,!ddeagent                         
  50.           WOS2VDMApps=!clipwos2,!ddeagent                             
  51.                                                                       
  52.    DDE is "automatically" set public by the presence of the             
  53.    !ddeagent entry.  The !ddeagent entry starts and minimizes the       
  54.    WIN-OS/2 DDE Agent when a vdm is loaded.                             
  55.  
  56.                                                                         
  57.    PM                                                                   
  58.    --                                                                   
  59.  
  60.      An entry for "Data Update" should be in the PM Window List         
  61.      after executing a WIN-OS/2 session. Should this get closed, PM     
  62.      DDE communication will become private.  DDE messages will be       
  63.      transferred between vdm's but not to PM. To restart Data Update,   
  64.      open the "Productivity" folder located in "OS/2 System" folder an  
  65.      double-click on the "Data Update" object.                          
  66.  
  67.                                                                         
  68.    WIN-OS/2                                                             
  69.    --------                                                             
  70.  
  71.      An entry for "DDE Interchange Agent" should be in the WIN-OS/2     
  72.      Task List. Should this get closed, DDE communication becomes       
  73.      private for this vdm.  To restart the DDE Agent, click on the      
  74.      DDE Interchange Agent located in the "WIN-OS/2 Accessories"        
  75.      folder.                                                            
  76.  
  77.                                                                         
  78.    Changing Default from Public to Private                              
  79.    ---------------------------------------                              
  80.  
  81.      DDE defaults to public. To change the default remove the           
  82.      !ddeagent entries from the system.ini file.                        
  83.                                                                         
  84.       To set a particular vdm private, close the "DDE Interchange       
  85.       Agent" in the respective vdm by clicking once with the left       
  86.       mouse button on the minimized "DDE Interchange Agent" icon and    
  87.       selecting close.                                                  
  88.                                                                         
  89.       Note : There is no way to selectively set DDE private in          
  90.              seamless WIN-OS/2 sessions.                                
  91.  
  92.                                                                         
  93.   2.0+ (Anything after 2.0)                                             
  94.   -------------------------                                             
  95.                                                                         
  96.     The agents have been converted from executables to dll's, and       
  97.     are loaded if the you have specified that you want DDE to be        
  98.     public.                                                             
  99.                                                                         
  100.     Required files:                                                     
  101.          c:\os2\pmdde.dll                      (the PM DDE agent)       
  102.          c:\os2\mdos\winos2\system\winsdde.dll (the WIN-OS/2 DDE agent) 
  103.          c:\os2\mdos\vwin.sys                  (inter-vdm IPC handler)  
  104.                                                                         
  105.     There are no required entries in the c:\os2\mdos\winos2\system.ini  
  106.     file.  DDE is "automatically" made public when the above dll's      
  107.     are loaded during vdm startup.  If the dll's are not present, DDE   
  108.     will be private.                                                    
  109.                                                                         
  110.     You will no longer see an entry for "Data Update" in the PM         
  111.     You will no longer see an entry for "Data Update" in the PM        
  112.     Window List or "DDE Interchange Agent" the WIN-OS/2 Task List.     
  113.  
  114.                                                                        
  115.     Changing Default from Public to Private                            
  116.     ---------------------------------------                            
  117.  
  118.       DDE still defaults to public, but there are now settings which   
  119.       allow you to switch between public and private.  To change       
  120.       the default use the "WIN-OS/2 Setup" object located in the       
  121.       "System Setup" folder which is in the "OS/2 System" folder.      
  122.         -  Set Dynamic Data Exchange private on the Data Exchange page 
  123.            to stop DDE communication between PM and WIN-OS/2.          
  124.         -  Set the WIN_DDE WIN-OS/2 setting "off" to make all vdm's    
  125.            private.  This setting is accessed through the push button  
  126.            on the 3.1 Session Page.                                    
  127.  
  128.                                                                        
  129.   Special Considerations                                               
  130.   ----------------------                                               
  131.  
  132.     When running full screen,VIDEO_SWITCH_NOTIFICATION must be set     
  133.     to "On" and VIDEO_8514A_XGA_IOTRAP must be set to "Off".           
  134.     Note: With OS/2 2.1, VIDEO_8514A_XGA_IOTRAP has been renamed       
  135.           to VIDEO_DEVICE_IOTRAP.                                      
  136.                                                                        
  137.     For any release of OS/2 other than 2.1, these settings are not the 
  138.     default. These setting are located on the WIN-OS/2 Settings page.  
  139.     The setting page is displayed when you click on the "WIN-OS/2      
  140.     Settings" push button located on the "Settings" notebook page for  
  141.     an object.  The "Settings" notebook page can be displayed by       
  142.      pressing the RIGHT mouse button on an object, and selecting the     
  143.      "Settings" submenu of the "Open" menu item.                         
  144.                                                                          
  145.      It is also recommended that the os/2 desktop icon                   
  146.      (in the lower left-hand side of the screen) is used to              
  147.      when switching out of a fullscreen session.  Using                  
  148.      alt-esc to switch between sessions has been known to                
  149.      cause some applications (such as Excel) to ignore DDE               
  150.      messages.  (The alt key puts applications into menu-mode.)          
  151.  
  152.                                                                          
  153.    Known Restrictions                                                    
  154.    ------------------                                                    
  155.  
  156.      The ONLY coding recommendation is that a Windows DDE Client         
  157.      application should not broadcast the following during the           
  158.      processing of its WM_CREATE message:                                
  159.                                                                          
  160.      SendMessage                                                         
  161.          (0xFFFF,WM_DDE_INITIATE,hwnd,MAKELONG (atomAppName, atomTopic)) 
  162.                                                                          
  163.      In later versions of OS/2 (post GA 2.0) the dll's required to       
  164.      exchange DDE between WIN-OS/2 and PM may still be in the process    
  165.      of being loaded.                                                    
  166.                                                                          
  167.                                                                          
  168. CLIPBOARD                                                                
  169. =========                                                                
  170.  
  171.    Implementation                                                        
  172.    --------------                                                        
  173.    In OS/2 2.x, all exchange of clipboard formats between WIN-OS/2       
  174.    and PM, or between separate WIN-OS/2 sessions, is also handled by     
  175.    "agents". These agents are responsible for the conversion of the      
  176.    clipboard formats. They must be running for clipboard information     
  177.    to be exchanged between sessions.                                     
  178.                                                                          
  179.    PUBLIC  - Clipboard formats are exported and imported between PM and  
  180.              WIN-OS/2 sessions.                                          
  181.                                                                          
  182.    PRIVATE - Clipboard data is contained within a single session only.   
  183.              No clipboard data will be transferred out of or into the    
  184.              vdm.                                                        
  185.                                                                          
  186.                                                                          
  187.    OS/2 2.0                                                              
  188.    --------                                                              
  189.  
  190.      The following are the names and locations of the agents needed to   
  191.      make clipboard public:                                              
  192.                                                                          
  193.        c:\os2\clipos2.exe               (PM clipboard agent/viewer)      
  194.        c:\os2\mdos\winos2\clipwos2.exe  (WIN-OS/2 clipboard agent/viewer 
  195.        c:\os2\mdos\winos2\vdmserver.exe (inter-vdm IPC handler)          
  196.                                                                         
  197.      In the c:\os2\mdos\winos2\system.ini, the following statements are 
  198.      required to start the WIN-OS/2 clipboard agent:                    
  199.                                                                         
  200.           SAVDMApps=!gopm,!clipwos2,!ddeagent                           
  201.           MAVDMApps=!gopm,!clipwos2,!ddeagent                           
  202.           WOS2VDMApps=!clipwos2,!ddeagent                               
  203.                                                                         
  204.      Clipboard is "automatically" set public by the presence of the     
  205.      !clipwos2 entry. The !clipwos2 entry starts and minimizes the      
  206.      WIN-O/2 Clipboard Agent when a vdm is loaded.                      
  207.  
  208.                                                                         
  209.      PM                                                                 
  210.      --                                                                 
  211.  
  212.        An entry for "Clipboard" should be in the PM Window List after   
  213.        executing a WIN-OS/2 session. Should this get closed, PM's       
  214.        clipboard will become private.  Data will be transferred between 
  215.        vdm's but not to PM. To restart the PM Clipboard, open the       
  216.        "Productivity" folder located in "OS/2 System" folder and        
  217.        double-click on the "Clipboard Viewer" object.                   
  218.  
  219.                                                                         
  220.      WIN-OS/2                                                           
  221.      --------                                                           
  222.  
  223.        An entry for "Clipboard" should be in the WIN-OS/2 Task List.    
  224.        Should this get closed, the vdm's clipboard will become private. 
  225.        To restart the clipboard, click on the clipboard object located  
  226.        in the "WIN-OS/2 Accessories" folder.                             
  227.  
  228.                                                                          
  229.      Changing Default from Public to Private                             
  230.      ---------------------------------------                             
  231.  
  232.        Clipboard defaults to public. To change the default remove the    
  233.        !clipwos2 entries from the system.ini file.                       
  234.                                                                          
  235.        To set a particular vdm private, deselect "Public Clipboard"      
  236.        which is located in the "Options" menu bar of the WIN-OS/2        
  237.        Clipboard Viewer.                                                 
  238.        Note : There is no way to selectively set the clipboard private   
  239.               in seamless WIN-OS/2 sessions.                             
  240.                                                                          
  241.  
  242.    2.0+ (Anything after 2.0)                                             
  243.    -------------------------                                             
  244.  
  245.      The agents have been converted from executables to dll's, and are   
  246.      loaded if you have specified that you want the clipboard to         
  247.      be public.                                                          
  248.                                                                          
  249.      Required files:                                                     
  250.         c:\os2\pmclip.dll                      (PM Clipboard agent)      
  251.         c:\os2\mdos\winos2\system\winsclip.dll (WIN-OS/2 Clipboard agent 
  252.         c:\os2\mdos\vwin.sys                   (inter-vdm IPC handler)   
  253.                                                                          
  254.      There are no required entries in the c:\os2\mdos\winos2\system.ini  
  255.      file. Clipboard is "automatically" made public when the above dll's 
  256.      are loaded during vdm startup.  If the dll's are not present,       
  257.      clipboard will be private.                                          
  258.                                                                          
  259.      You will no longer see an entry for "Clipboard" in the PM Window    
  260.      List or the WIN-OS/2 Task List.                                     
  261.  
  262.                                                                          
  263.      Changing Default from Public to Private                             
  264.      ---------------------------------------                             
  265.  
  266.      Setting the clipboard to public or private is no longer done with   
  267.      the Clipboard Viewer. To change the default use the                 
  268.      "WIN-OS/2 Setup" object located in the "System Setup" folder        
  269.      which is in the "OS/2 System" folder.                               
  270.        -  Set Clipboard "private" on the Data Exchange page to           
  271.           stop the transferring of clipboard data between PM and         
  272.           WIN-OS/2.                                                      
  273.        -  Set the WIN_CLIPBOARD setting "off" to make all vdm's private. 
  274.           This is accessed through the push button on the 3.1 Session    
  275.           Page.                                                          
  276.                                                                          
  277.        To set a particular vdm private, set the WIN_CLIPBOARD setting    
  278.        "off" for that vdm.  This is accessed through the vdm's notebook  
  279.        settings.  Click on the WIN-OS/2 settings push button on the      
  280.        session page and set WIN_CLIPBOARD "off".                         
  281.  
  282.                                                                          
  283.    Special Considerations                                                
  284.    ----------------------                                                
  285.  
  286.      When running full screen,VIDEO_SWITCH_NOTIFICATION must be set     
  287.      to "On" and VIDEO_8514A_XGA_IOTRAP must be set to "Off".           
  288.      Note: With OS/2 2.1, VIDEO_8514A_XGA_IOTRAP has been renamed       
  289.            to VIDEO_DEVICE_IOTRAP.                                      
  290.                                                                         
  291.      For any release of OS/2 other than 2.1, these settings are not the 
  292.      default. These setting are located in the WIN-OS/2 Settings page.  
  293.      The setting page is displayed when you click on the "WIN-OS/2      
  294.      Settings" push button located on the "Settings" notebook page for  
  295.      an object . The "Settings" notebook page can be displayed by       
  296.      pressing the RIGHT mouse button on an object, and selecting the    
  297.      "Settings" submenu of the "Open" menu item.                        
  298.  
  299.                                                                         
  300.    Known Restrictions                                                   
  301.    ------------------                                                   
  302.  
  303.       - No metafile/picture format conversion between WIN-OS/2 and PM.  
  304.         If a PM application copies a metafile to the clipboard, the     
  305.         agents do not transfer this format to the WIN-OS/2 clipboard.   
  306.         If a Windows application copies a picture to the clipboard, the 
  307.         agents do not transfer this format to the PM clipboard.         
  308.  
  309.                                                                         
  310. DEVELOPMENT                                                             
  311. ===========                                                             
  312.  
  313.    There are no special coding requirements (except those specified     
  314.    under DDE, Known Restrictions) to transfer clipboard or DDE data     
  315.    between WIN-OS/2 and PM.  A developer simply codes the application   
  316.                                                                         
  317.    in its native environment. That is, if you are writing an            
  318.    application for the PM environment you would code it as if you are   
  319.    communicating with another PM application. The same applies to the   
  320.    WIN-OS/2 environment.                                                
  321.                                                                         
  322.  
  323. ADDITIONAL INFORMATION                                                  
  324. ======================                                                  
  325.  
  326.    See the "README" located in the root directory of the drive on which 
  327.    you installed OS/2 (for example c:\readme) for additional DDE and    
  328.    clipboard considerations. Additional information can be found in the 
  329.    "Master Help Index", subjects entitled "DDE (dynamic data exchange)" 
  330.     and "CLIPBOARD".                                                    
  331.                                                                         
  332. Regards Glenn Puchtel (Boca Programming Center)                         
  333.         Lisa  Garcia  (Boca Programming Center)                         
  334.  
  335.