home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / shr93.zip / WPS-PGM.TXT < prev   
Text File  |  1993-04-12  |  9KB  |  267 lines

  1. OS/2 Work Place Shell Sample Program
  2.  
  3. Copyright (C) 1993 IBM Corporation
  4.  
  5.   DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  6.   sample code created by IBM Corporation.  This sample code is
  7.   not part of any standard or IBM product and is provided to you
  8.   solely for the purpose of assisting you in the development of
  9.   your applications.  The code is provided "AS IS", without
  10.   warranty of any kind.  IBM shall not be liable for any damages
  11.   arising out of your use of the sample code, even if they have
  12.   been advised of the possibility of such damages.
  13.  
  14. Introduction
  15.  
  16.   Here is a list of problems encountered while writing various 
  17.   subclasses of the WPS hierarchy.  Where possible, workarounds
  18.   have been documented.  Boca is aware of these problems and plans
  19.   to address them after 2.1 has shipped.
  20.  
  21.   The problems below are known to be accurate as of 04/12/93.
  22.   Later releases of OS/2 may have corrected all or some of these
  23.   problems.
  24.  
  25. Problem 1:
  26.  
  27.   WPS subclasses the hwndFrame window passed in on the 
  28.   wpRegisterView, and also will subclass the owner of the hwndCnr 
  29.   passed in on wpCnrInsertObject.  The WPS container owner 
  30.   subclass handles many of the WM_CONTROL (CN_) notification 
  31.   messages from the container control to provide standard WPS 
  32.   object behavior, eg, drag/drop and pop-up menus.  
  33.  
  34.   After calling wpRegisterView, the container owner frame 
  35.   window procedure subclass chain looks like this:
  36.  
  37.     1. WPS container owner subclass procedure, first, followed by
  38.     2. Your frame subclass, followed by
  39.     3. WC_FRAME, followed by
  40.     4. WinDefWindowProc last.
  41.  
  42.   ADDRBKV.C has example code that shows how (1) and (2) can be 
  43.   reversed so your window procedure gets messages before the WPS 
  44.   container owner subclass window procedure.  Putting your window 
  45.   procedure before the WPS is part of the workaround for "Problem 
  46.   7" below.
  47.  
  48.   There is no direct API to access the WPS container owner 
  49.   subclass window procedure (ie, it is not a registered window 
  50.   class like WC_FRAME).  
  51.  
  52.   Indirectly the WPS container owner subclass window procedure can 
  53.   be accessed by calling wpCnrInsertObject, which subclasses the 
  54.   container owner, or wpRegisterView, which also subclasses the 
  55.   container owner.  
  56.  
  57.   One possible long-term solution is to provide a 
  58.   "wpCnrRegisterOwner" API for frame owners of containers.  Note 
  59.   that WPS container owners MUST be subclasses of WC_FRAME!  
  60.  
  61. Workaround for Problem 1:
  62.  
  63.   Either call wpCnrInsertObject followed by wpCnrRemoveObject
  64.   (for example, inserting/removing the desktop object), or
  65.   call wpRegisterView, followed by WinSubclassWindow.  See
  66.   ShrOpenAddressBook in ADDRBKV.C.
  67.  
  68. Problem 2:
  69.  
  70.   The WPS container owner subclass window procedure assumes 
  71.   FID_CLIENT is a container.  If you need more than one WPS object 
  72.   container in a dialog, you must create a "dummy" frame owner
  73.   who has a single child window, a container with ID FID_CLIENT.  
  74.  
  75.   Possible long-term solution is to have the WPS container owner 
  76.   subclass window procedure keep track of the ID or hwnd of its 
  77.   owned container.  
  78.  
  79. Problem 3:
  80.  
  81.   The wpCnrRemoveObject method always invalidates the record.  
  82.   This causes excessive redraw when removing several objects in
  83.   succession.
  84.  
  85. Workaround for Problem 3:
  86.  
  87.   Use WinEnableWindowUpdate(hwndCnr,FALSE), remove all of your 
  88.   objects with "wpCnrRemoveObject(OBJECT_FROM_PREC(pMiniRecord), 
  89.   hwndCnr)", followed by WinShowWindow(hwndCnr,TRUE).  See 
  90.   ShrEmptyObjectCnr in SHARE.C for more details.  
  91.  
  92.   Possible long-term solution is to add a flInvalidateRecord flag
  93.   to wpCnrRemoveObject or add a wpCnrRemoveMultObjects API.
  94.  
  95. Problem 4:
  96.  
  97.   The "open folders" list shown on the "Opened" page of the 
  98.   "Copy...", "Move...", and "Create shadow..."  dialogs do not 
  99.   include open alternative folder views.  Only the open standard 
  100.   folder views of Icon, Details, and Tree are shown.  
  101.  
  102. Workaround for Problem 4:
  103.  
  104.   None.
  105.  
  106. Problem 5:
  107.  
  108.   Subfolders inherit their default view from their parent folder.  
  109.   If a new parent folder view is defined, the subfolders do not 
  110.   open when double-clicked because they don't support the view of
  111.   the parent.
  112.  
  113. Workaround for Problem 5:
  114.  
  115.   Don't subclass wpclsQueryDefaultView or wpQueryDefaultView
  116.   in your alternative folder view (ie, return one of the  
  117.   standard folder views: Icon, Details, or Tree).
  118.  
  119. Problem 6:
  120.  
  121.   Alternative folder views are not notified when an object is 
  122.   added or removed from the folder.
  123.  
  124. Workaround for Problem 6:
  125.  
  126.   Subclass from ShrFolder, which adds the methods 
  127.   shrAddedToContent and shrRemovedFromContent.
  128.  
  129. Problem 7:
  130.  
  131.   Help is not displayed for objects inserted into a container
  132.   with wpCnrInsertObject.
  133.  
  134. Workaround for Problem 7:
  135.  
  136.   Intercept WM_CONTROL (CN_HELP) in your frame container owner. 
  137.   Get the WPS object with OBJECT_FROM_PREC, followed by 
  138.   wpQueryDefaultHelp and then wpDisplayHelp.  See "Problem 1" 
  139.   above for more details.
  140.  
  141. Problem 8:
  142.  
  143.   The 'Selected' menu bar choice defined by CUA is very difficult 
  144.   to implement.
  145.  
  146. Workaround for Problem 8:
  147.  
  148.   None.  Menu bars can be added to the frame of a container owner 
  149.   only with great care.  Setting the owner of the menu bar to be 
  150.   the system menu appears to avoid confusing the WPS container 
  151.   owner subclass window procedure.
  152.  
  153. Problem 9:
  154.  
  155.   New base classes cannot be defined (WPAbstract, WPTransient, 
  156.   WPFileSystem).  Defining a DIRECT subclass of WPObject hangs the 
  157.   system.  
  158.  
  159. Workaround for Problem 9:
  160.  
  161.   None.
  162.  
  163. Problem 10:
  164.  
  165.   The hwndCnr parameter is NULLHANDLE if a pop-up request is made 
  166.   on the "whitespace" of an open view.  It should be the handle of 
  167.   the container requesting the pop-up menu (eg, to use it to 
  168.   display a different pop-up menu for different views).  Same is 
  169.   true for wpFilterPopupMenu.  
  170.  
  171. Workaround for Problem 10:
  172.  
  173.   None.
  174.  
  175. Problem 11:
  176.  
  177.   WPS sometimes copies subclasses of WPFileSystem directly using 
  178.   the DosCopy API (ie, bypassing the wpCopyObject method).  These 
  179.   "sneaky copies" don't allow the subclass an opportunity to 
  180.   update its internal data.  That is, some of its data cannot be 
  181.   copied byte for byte, it has to be updated for the new copy.  
  182.  
  183. Workaround for Problem 11:
  184.  
  185.   Make the object class style CLSSTYLE_NEVERCOPY to prevent WPS 
  186.   from calling DosCopy.
  187.  
  188.   A long-term solution might be for WPS to provide a new class 
  189.   style, CLSSTYLE_NOSNEAKYCOPY.  
  190.  
  191. Problem 12:
  192.  
  193.   A hang (infinite loop) results if an object is inserted with
  194.   wpCnrInsertObject and is then deleted from another open view.
  195.  
  196. Workaround for Problem 12:
  197.  
  198.   The problem has been reported to Boca.  In the meantime, call
  199.   ShrCheckForDeletedObject in your frame container owner subclass 
  200.   at the beginning of your window procedure for each message it 
  201.   receives.
  202.  
  203.   See ShrFrameCnrOwnerWndProc in SHARE.C for more details.
  204.  
  205. Problem 13:
  206.  
  207.    Not really a problem per se, but there should be a
  208.    wpclsQueryObjectFromID method.  Today, you have to use
  209.    WinQueryObject to get the HOBJECT followed by wpclsQueryObject.
  210.    WinQueryObject causes a cross process switch.
  211.  
  212. Problem 14:
  213.  
  214.   Suppose address book subclass of folder is created.  It displays
  215.   a new alternative folder view who's window structure is:  
  216.  
  217.     hwndFrame
  218.       hwndNotebook
  219.       hwndFrameCnrOwner
  220.         hwndCnr
  221.  
  222.   WPS assumes containers which contain WPS objects are direct 
  223.   children of the frame and that the container has an ID of 
  224.   FID_CLIENT.  Since the notebook is needed between the frame and 
  225.   the container, an extra frame, hwndFrameCnrOwner, was created.  
  226.   This works pretty well for most scenarios, except when bringing 
  227.   up the pop-up menu of the address book by MB2 on the whitespace
  228.   of hwndCnr.  
  229.  
  230.   In version 2.0 ONLY (GA and GA+SP), this results in the wrong 
  231.   owner being set and 'Copy', 'Move' etc WM_COMMAND messages being 
  232.   sent to the wrong frame (the desktop).  So "Copy..."  selected 
  233.   from the address book actually displays a dialog titled "Drive 
  234.   C" as the folder, and "OS/2 2.0 Desktop" as the source.  
  235.  
  236.   Note that in both versions (2.0 and 2.1 beta), the pop-up menu
  237.   emphasis is not shown for this scenario.  
  238.  
  239. Problem 14:
  240.  
  241.   Cannot update details view when underlying object data 
  242.   defined in a subclass changes.
  243.  
  244. Workaround for Problem 14:
  245.  
  246.   Call ShrCnrRefreshDetails (defined in SHRFOLDR.H).  See
  247.   NOTIFY.C for an example.
  248.  
  249. Problem 15:
  250.  
  251.   The iPosition parameter in the _wpInsertPopupMenuItems method is 
  252.   ignored.  
  253.  
  254. Workaround for Problem 15:
  255.  
  256.   Use the menu messages directly, eg, MM_INSERTITEM.
  257.  
  258. Problem 16:
  259.  
  260.   Multiple WPS subclasses in the same DLL would sometimes be
  261.   spontaneously unloaded by WPS on OS/2 2.0 GA causing
  262.   a trap.
  263.  
  264. Workaround for Problem 16:
  265.  
  266.   Have each class in a separate DLL, or upgrade to OS/2 2.1.
  267.