home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / tlktbeta / samples / wpstutor / wpstutor.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-13  |  80.1 KB  |  2,740 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: wpstutor.c.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitc: 1.24
  8.  */
  9.  
  10. /*
  11.  *
  12.  *
  13.  *   Module Name: WPSTUTOR
  14.  *
  15.  *   Description: OS/2 Work Place Shell Sample Program
  16.  *
  17.  *                This class subclasses the WPDataFile class.  Most WPS
  18.  *                instance and class methods are overridden to invoke
  19.  *                'DisplayMethodInfo'.  This function uses a named pipe
  20.  *                to communicate with the 'Show Method Description'
  21.  *                (SHOWDESC.EXE) program, which displays the name and a
  22.  *                description of the method that invoked
  23.  *                'DisplayMethodInfo'.
  24.  *
  25.  *   Copyright (C) 1993 IBM Corporation
  26.  *
  27.  *       DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  28.  *       sample code created by IBM Corporation. This sample code is not
  29.  *       part of any standard or IBM product and is provided to you solely
  30.  *       for  the purpose of assisting you in the development of your
  31.  *       applications.  The code is provided "AS IS", without
  32.  *       warranty of any kind.  IBM shall not be liable for any damages
  33.  *       arising out of your use of the sample code, even if they have been
  34.  *       advised of the possibility of such damages.
  35.  *
  36.  */
  37.  
  38.  
  39. #define WPSTutorial_Class_Source
  40. #define M_WPSTutorial_Class_Source
  41. #include "wpstutor.ih"              /* Implementation header emitted from    */
  42.                                     /*   WPSTUTOR.CSC                        */
  43. #include "wpstutor.ph"              /* Private header emitted from           */
  44.                                     /*   WPSTUTOR.CSC                        */
  45. #include "methodid.h"               /* Method IDs sent to SHOWDESC.EXE       */
  46.  
  47.  
  48. /*********************** NON-METHOD FUNCTION PROTOTYPES ***********************
  49. ******************************************************************************/
  50. MRESULT EXPENTRY WPSTutorWndProc( HWND hwnd, ULONG msg, MPARAM mp1,
  51.                                   MPARAM mp2 );
  52. ULONG   DisplayMethodThread(VOID);
  53. VOID    DisplayMethodInfo(ULONG ulMethodID);
  54.  
  55.  
  56. /********************************** DEFINES ***********************************
  57. ******************************************************************************/
  58. #define DISPLAY_PROGRAM_NAME "ShowDesc.EXE\0"
  59.                                  /* File name of the Show Method Description */
  60.                                  /*   program                                */
  61. #define NPIPE_COUNT   0x0002     /* Instance count for the pipe used to      */
  62.                                  /*   communicate with Show Method Desc.     */
  63.  
  64.  
  65. /***************** GLOBAL/STATIC (NON-INSTANCE) DATA SECTION ******************
  66. *****                                                                     *****
  67. *****    This data shouldn't be changed by instance methods or it will    *****
  68. *****    effect all instances!  Any variables that are specific (unique   *****
  69. *****    values) for each instance of this object should be declared as   *****
  70. *****  instance data or dynamically allocated and stored as window data.  *****
  71. *****                                                                     *****
  72. *****      This global data should be declared as class instance data     *****
  73. *****    if it will change after initialization.  In this case, it will   *****
  74. *****                  be accessed through class methods.                 *****
  75. *****                                                                     *****
  76. ******************************************************************************/
  77.  
  78. CHAR    szTutorialWindowClass[] = "WPSTUTORSAMPLE";
  79.                                  /* Window class name for the                */
  80.                                  /*   'Open tutorial' view                   */
  81. HPIPE   hNPipe;                  /* Pipe used to communicate with            */
  82.                                  /*   SHOWDESC.EXE                           */
  83. PID     ShowMethDescPID;         /* PID for SHOWDESC.EXE process             */
  84. BOOL    fProgramStarted = FALSE; /* Flag indicating if the SHOWDESC.EXE      */
  85.                                  /*   program is up                          */
  86. HMODULE hmod = NULLHANDLE;       /* Module handle for the class DLL          */
  87.  
  88.  
  89. /*************************  INSTANCE METHODS SECTION  *************************
  90. *****                                                                     *****
  91. *****              Do not put any code in this section unless             *****
  92. *****                   it is an object INSTANCE method                   *****
  93. *****                                                                     *****
  94. ******************************************************************************/
  95.  
  96. #undef SOM_CurrentClass
  97. #define SOM_CurrentClass SOMInstance
  98.  
  99. /*
  100.  *
  101.  *  METHOD: DisplayTitleInfo                               ( ) PRIVATE
  102.  *                                                         (X) PUBLIC
  103.  *  DESCRIPTION:
  104.  *
  105.  *    This method handles the processing of the "Open tutorial" menu item
  106.  *    in the "Open" menu of the object's context menu.  The method creates a
  107.  *    PM window in order to display the (backwards) title of the object in
  108.  *    the window's title bar.
  109.  *
  110.  *  RETURN:
  111.  *
  112.  *    HWND - Handle to the window created
  113.  *
  114.  */
  115.  
  116. SOM_Scope HWND   SOMLINK wpstut_DisplayTitleInfo(WPSTutorial *somSelf)
  117. {
  118.    HAB         hab;                     /* PM anchor block handle            */
  119.    PWINDOWDATA pWindowData;             /* Instance data reserved storage    */
  120.    FRAMECDATA  flFrameCtlData;          /* Frame control data                */
  121.    HWND        hwndFrame = NULLHANDLE;  /* Frame window handle               */
  122.    HWND        hwndClient = NULLHANDLE; /* Client window handle              */
  123.  
  124.    /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  125.    WPSTutorialMethodDebug("WPSTutorial","wpstut_DisplayTitleInfo");
  126.  
  127.    /*
  128.    **  Get the anchor block so we can register the window class.
  129.    */
  130.    hab = WinQueryAnchorBlock(HWND_DESKTOP);
  131.  
  132.    if (!WinRegisterClass(hab,
  133.                          szTutorialWindowClass,
  134.                          (PFNWP)WPSTutorWndProc ,
  135.                          CS_SYNCPAINT,
  136.                          sizeof(pWindowData)))
  137.    {
  138.       DebugBox("DisplayTitleInfo", "Failure in WinRegisterClass");
  139.       return NULLHANDLE ;
  140.    }
  141.  
  142.    /*
  143.    **  Allocate some instance specific data in the Window words of the Frame
  144.    **  window.  This will insure that our window procedure can use the
  145.    **  object's methods because our window procedure isn't passed a
  146.    **  *somSelf pointer.
  147.    */
  148.    pWindowData = (PWINDOWDATA) _wpAllocMem(somSelf, sizeof(*pWindowData), NULL);
  149.  
  150.    if (!pWindowData)
  151.    {
  152.       DebugBox("DisplayTitleInfo", "wpAllocMem failed to allocate pWindowData");
  153.       return NULLHANDLE;
  154.    }
  155.  
  156.    /*
  157.    **  Initialize the instance data
  158.    */
  159.    memset((PVOID) pWindowData, 0, sizeof(*pWindowData));
  160.    pWindowData->cb = sizeof(*pWindowData);
  161.    pWindowData->somSelf = somSelf;
  162.  
  163.    /*
  164.    **  Create a frame window as a child of the desktop to allow the user to
  165.    **  manipulate the window.  Set the frame control data so the frame has a
  166.    **  title bar, system menu, minimize and maximize buttons, and a sizing
  167.    **  border.
  168.    */
  169.    flFrameCtlData.cb            = sizeof(flFrameCtlData);
  170.    flFrameCtlData.flCreateFlags = FCF_TITLEBAR | FCF_SYSMENU | FCF_MINMAX |
  171.                                   FCF_SIZEBORDER | FCF_SHELLPOSITION;
  172.    flFrameCtlData.hmodResources = hmod;
  173.    flFrameCtlData.idResources   = 0;
  174.  
  175.    hwndFrame = WinCreateWindow(
  176.       HWND_DESKTOP,             /* Parent-window handle                      */
  177.       WC_FRAME,                 /* Registered-class name (Frame)             */
  178.       _wpQueryTitle(somSelf),   /* Window text                               */
  179.       0,                        /* Window style                              */
  180.       0, 0, 0, 0,               /* Window position (x, y, width, height)     */
  181.       NULLHANDLE,               /* Owner-window handle                       */
  182.       HWND_TOP,                 /* Sibling-window handle (on top of all)     */
  183.       (USHORT) ID_FRAME,        /* Window identifier                         */
  184.       (PVOID) &flFrameCtlData,  /* Class-specific control data               */
  185.       NULL);                    /* Presentation parameters (none)            */
  186.  
  187.    if (!hwndFrame)
  188.    {
  189.       DebugBox("DisplayTitleInfo", "Failure in WinCreateWindow (Frame)");
  190.       return NULLHANDLE;
  191.    }
  192.  
  193.    /*
  194.    **  Create a client window as a child of the frame for use by the object
  195.    **  to display information and solicit user input.
  196.    */
  197.    hwndClient = WinCreateWindow(
  198.          hwndFrame,             /* Parent-window handle (create object win)  */
  199.          szTutorialWindowClass, /* Registered-class name (our class)         */
  200.          NULL,                  /* Window text                               */
  201.          0,                     /* Window style                              */
  202.          0, 0, 0, 0,            /* Window position (x, y, width, height)     */
  203.          hwndFrame,             /* Owner-window handle                       */
  204.          HWND_TOP,              /* Sibling-window handle                     */
  205.          (USHORT)FID_CLIENT,    /* Window identifier (client window)         */
  206.          pWindowData,           /* Control data                              */
  207.          NULL);                 /* Presentation parameters (none)            */
  208.  
  209.    if (!hwndClient)
  210.    {
  211.       WinDestroyWindow(hwndFrame);
  212.       DebugBox("DisplayTitleInfo", "Failure in WinCreateWindow (Client)");
  213.       return NULLHANDLE;
  214.    }
  215.  
  216.    /*
  217.    **  Set the icon to be associated with the window with the icon for
  218.    **  the class.
  219.    */
  220.    WinSendMsg(hwndFrame, WM_SETICON, MPFROMP(_wpQueryIcon(somSelf)), NULL);
  221.  
  222.    /*
  223.    **  Restore the window position. NOTE: If there is no stored location,
  224.    **  the window position will be determined by the shell due to the
  225.    **  FCF_SHELLPOSITION frame creation flag.
  226.    */
  227.    WinRestoreWindowPos(szTutorialWindowClass, _wpQueryTitle(somSelf),
  228.                        hwndFrame);
  229.  
  230.    /*
  231.    **  Make the window visible.
  232.    */
  233.    WinShowWindow(hwndFrame, TRUE);
  234.  
  235.    return hwndFrame;                                              /* success */
  236. }
  237.  
  238.  
  239. /************************ OVERRIDDEN INSTANCE METHODS *************************
  240. ******************************************************************************/
  241.  
  242. /*
  243.  *
  244.  *   METHOD: wpAddFileMenuPage                              ( ) PRIVATE
  245.  *                                                          (X) PUBLIC
  246.  *   DESCRIPTION:
  247.  *
  248.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  249.  *
  250.  */
  251.  
  252. SOM_Scope ULONG   SOMLINK wpstut_wpAddFileMenuPage(WPSTutorial *somSelf,
  253.                 HWND hwndNotebook)
  254. {
  255.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  256.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddFileMenuPage");
  257.  
  258.     DisplayMethodInfo(IDS_WPADDFILEMENUPAGE);
  259.  
  260.     return (parent_wpAddFileMenuPage(somSelf,hwndNotebook));
  261. }
  262.  
  263. /*
  264.  *
  265.  *   METHOD: wpAddFileTypePage                              ( ) PRIVATE
  266.  *                                                          (X) PUBLIC
  267.  *   DESCRIPTION:
  268.  *
  269.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  270.  *
  271.  */
  272.  
  273. SOM_Scope ULONG   SOMLINK wpstut_wpAddFileTypePage(WPSTutorial *somSelf,
  274.                 HWND hwndNotebook)
  275. {
  276.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  277.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddFileTypePage");
  278.  
  279.     DisplayMethodInfo(IDS_WPADDFILETYPEPAGE);
  280.  
  281.     return (parent_wpAddFileTypePage(somSelf,hwndNotebook));
  282. }
  283.  
  284. /*
  285.  *
  286.  *   METHOD: wpAddFile1Page                                 ( ) PRIVATE
  287.  *                                                          (X) PUBLIC
  288.  *   DESCRIPTION:
  289.  *
  290.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  291.  *
  292.  */
  293.  
  294. SOM_Scope ULONG   SOMLINK wpstut_wpAddFile1Page(WPSTutorial *somSelf,
  295.                 HWND hwndNotebook)
  296. {
  297.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  298.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddFile1Page");
  299.  
  300.     DisplayMethodInfo(IDS_WPADDFILE1PAGE);
  301.  
  302.     return (parent_wpAddFile1Page(somSelf,hwndNotebook));
  303. }
  304.  
  305. /*
  306.  *
  307.  *   METHOD: wpAddFile2Page                                 ( ) PRIVATE
  308.  *                                                          (X) PUBLIC
  309.  *   DESCRIPTION:
  310.  *
  311.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  312.  *
  313.  */
  314.  
  315. SOM_Scope ULONG   SOMLINK wpstut_wpAddFile2Page(WPSTutorial *somSelf,
  316.                 HWND hwndNotebook)
  317. {
  318.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  319.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddFile2Page");
  320.  
  321.     DisplayMethodInfo(IDS_WPADDFILE2PAGE);
  322.  
  323.     return (parent_wpAddFile2Page(somSelf,hwndNotebook));
  324. }
  325.  
  326. /*
  327.  *
  328.  *   METHOD: wpAddFile3Page                                 ( ) PRIVATE
  329.  *                                                          (X) PUBLIC
  330.  *   DESCRIPTION:
  331.  *
  332.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  333.  *
  334.  */
  335.  
  336. SOM_Scope ULONG   SOMLINK wpstut_wpAddFile3Page(WPSTutorial *somSelf,
  337.                 HWND hwndNotebook)
  338. {
  339.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  340.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddFile3Page");
  341.  
  342.     DisplayMethodInfo(IDS_WPADDFILE3PAGE);
  343.  
  344.     return (parent_wpAddFile3Page(somSelf,hwndNotebook));
  345. }
  346.  
  347. /*
  348.  *
  349.  *   METHOD: wpAddObjectGeneralPage                         ( ) PRIVATE
  350.  *                                                          (X) PUBLIC
  351.  *   DESCRIPTION:
  352.  *
  353.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  354.  *
  355.  */
  356.  
  357. SOM_Scope ULONG   SOMLINK wpstut_wpAddObjectGeneralPage(WPSTutorial *somSelf,
  358.                 HWND hwndNotebook)
  359. {
  360.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  361.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddObjectGeneralPage");
  362.  
  363.     DisplayMethodInfo(IDS_WPADDOBJECTGENERALPAGE);
  364.  
  365.     return (parent_wpAddObjectGeneralPage(somSelf,hwndNotebook));
  366. }
  367.  
  368. /*
  369.  *
  370.  *   METHOD: wpAddSettingsPages                             ( ) PRIVATE
  371.  *                                                          (X) PUBLIC
  372.  *   DESCRIPTION:
  373.  *
  374.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  375.  *
  376.  */
  377.  
  378. SOM_Scope BOOL   SOMLINK wpstut_wpAddSettingsPages(WPSTutorial *somSelf,
  379.                 HWND hwndNotebook)
  380. {
  381.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  382.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddSettingsPages");
  383.  
  384.     DisplayMethodInfo(IDS_WPADDSETTINGSPAGES);
  385.  
  386.     return (parent_wpAddSettingsPages(somSelf,hwndNotebook));
  387. }
  388.  
  389. /*
  390.  *
  391.  *   METHOD: wpAddToObjUseList                              ( ) PRIVATE
  392.  *                                                          (X) PUBLIC
  393.  *   DESCRIPTION:
  394.  *
  395.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  396.  *
  397.  */
  398.  
  399. SOM_Scope BOOL   SOMLINK wpstut_wpAddToObjUseList(WPSTutorial *somSelf,
  400.                 PUSEITEM pUseItem)
  401. {
  402.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  403.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAddToObjUseList");
  404.  
  405.     DisplayMethodInfo(IDS_WPADDTOOBJUSELIST);
  406.  
  407.     return (parent_wpAddToObjUseList(somSelf,pUseItem));
  408. }
  409.  
  410. /*
  411.  *
  412.  *   METHOD: wpAllocMem                                     ( ) PRIVATE
  413.  *                                                          (X) PUBLIC
  414.  *   DESCRIPTION:
  415.  *
  416.  *      This method is overridden to invoke 'DisplayMethodInfo'.
  417.  *
  418.  */
  419.  
  420. SOM_Scope PBYTE   SOMLINK wpstut_wpAllocMem(WPSTutorial *somSelf,
  421.                 ULONG cbBytes,
  422.                 PULONG prc)
  423. {
  424.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  425.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpAllocMem");
  426.  
  427.     DisplayMethodInfo(IDS_WPALLOCMEM);
  428.  
  429.     return (parent_wpAllocMem(somSelf,cbBytes,prc));
  430. }
  431.  
  432. /*
  433.  *
  434.  *   METHOD: wpClose                                        ( ) PRIVATE
  435.  *                                                          (X) PUBLIC
  436.  *   DESCRIPTION:
  437.  *
  438.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  439.  *
  440.  */
  441.  
  442. SOM_Scope BOOL   SOMLINK wpstut_wpClose(WPSTutorial *somSelf)
  443. {
  444.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  445.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpClose");
  446.  
  447.     DisplayMethodInfo(IDS_WPCLOSE);
  448.  
  449.     return (parent_wpClose(somSelf));
  450. }
  451.  
  452. /*
  453.  *
  454.  *   METHOD: wpCopiedFromTemplate                           ( ) PRIVATE
  455.  *                                                          (X) PUBLIC
  456.  *   DESCRIPTION:
  457.  *
  458.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  459.  *
  460.  */
  461.  
  462. SOM_Scope void   SOMLINK wpstut_wpCopiedFromTemplate(WPSTutorial *somSelf)
  463. {
  464.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  465.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpCopiedFromTemplate");
  466.  
  467.     DisplayMethodInfo(IDS_WPCOPIEDFROMTEMPLATE);
  468.  
  469.     parent_wpCopiedFromTemplate(somSelf);
  470. }
  471.  
  472. /*
  473.  *
  474.  *   METHOD: wpCopyObject                                   ( ) PRIVATE
  475.  *                                                          (X) PUBLIC
  476.  *   DESCRIPTION:
  477.  *
  478.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  479.  *
  480.  */
  481.  
  482. SOM_Scope WPObject *  SOMLINK wpstut_wpCopyObject(WPSTutorial *somSelf,
  483.                 WPFolder *Folder,
  484.                 BOOL fLock)
  485. {
  486.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  487.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpCopyObject");
  488.  
  489.     DisplayMethodInfo(IDS_WPCOPYOBJECT);
  490.  
  491.     return (parent_wpCopyObject(somSelf,Folder,fLock));
  492. }
  493.  
  494. /*
  495.  *
  496.  *   METHOD: wpCreateFromTemplate                           ( ) PRIVATE
  497.  *                                                          (X) PUBLIC
  498.  *   DESCRIPTION:
  499.  *
  500.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  501.  *
  502.  */
  503.  
  504. SOM_Scope WPObject *  SOMLINK wpstut_wpCreateFromTemplate(WPSTutorial *somSelf,
  505.                 WPFolder *folder,
  506.                 BOOL fLock)
  507. {
  508.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  509.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpCreateFromTemplate");
  510.  
  511.     DisplayMethodInfo(IDS_WPCREATEFROMTEMPLATE);
  512.  
  513.     return (parent_wpCreateFromTemplate(somSelf,folder,fLock));
  514. }
  515.  
  516. /*
  517.  *
  518.  *   METHOD: wpCreateShadowObject                           ( ) PRIVATE
  519.  *                                                          (X) PUBLIC
  520.  *   DESCRIPTION:
  521.  *
  522.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  523.  *
  524.  */
  525.  
  526. SOM_Scope WPObject *  SOMLINK wpstut_wpCreateShadowObject(WPSTutorial *somSelf,
  527.                 WPFolder *Folder,
  528.                 BOOL fLock)
  529. {
  530.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  531.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpCreateShadowObject");
  532.  
  533.     DisplayMethodInfo(IDS_WPCREATESHADOWOBJECT);
  534.  
  535.     return (parent_wpCreateShadowObject(somSelf,Folder,fLock));
  536. }
  537.  
  538. /*
  539.  *
  540.  *   METHOD: wpDelete                                       ( ) PRIVATE
  541.  *                                                          (X) PUBLIC
  542.  *   DESCRIPTION:
  543.  *
  544.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  545.  *
  546.  */
  547.  
  548. SOM_Scope ULONG   SOMLINK wpstut_wpDelete(WPSTutorial *somSelf,
  549.                 ULONG fConfirmations)
  550. {
  551.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  552.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDelete");
  553.  
  554.     DisplayMethodInfo(IDS_WPDELETE);
  555.  
  556.     return (parent_wpDelete(somSelf,fConfirmations));
  557. }
  558.  
  559. /*
  560.  *
  561.  *   METHOD: wpDeleteFromObjUseList                         ( ) PRIVATE
  562.  *                                                          (X) PUBLIC
  563.  *   DESCRIPTION:
  564.  *
  565.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  566.  *
  567.  */
  568.  
  569. SOM_Scope BOOL   SOMLINK wpstut_wpDeleteFromObjUseList(WPSTutorial *somSelf,
  570.                 PUSEITEM pUseItem)
  571. {
  572.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  573.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDeleteFromObjUseList");
  574.  
  575.     DisplayMethodInfo(IDS_WPDELETEFROMOBJUSELIST);
  576.  
  577.     return (parent_wpDeleteFromObjUseList(somSelf,pUseItem));
  578. }
  579.  
  580. /*
  581.  *
  582.  *   METHOD: wpDoesObjectMatch                              ( ) PRIVATE
  583.  *                                                          (X) PUBLIC
  584.  *   DESCRIPTION:
  585.  *
  586.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  587.  *
  588.  */
  589.  
  590. SOM_Scope BOOL   SOMLINK wpstut_wpDoesObjectMatch(WPSTutorial *somSelf,
  591.                 PVOID pvoidExtendedCriteria)
  592. {
  593.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  594.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDoesObjectMatch");
  595.  
  596.     DisplayMethodInfo(IDS_WPDOESOBJECTMATCH);
  597.  
  598.     return (parent_wpDoesObjectMatch(somSelf,pvoidExtendedCriteria));
  599. }
  600.  
  601. /*
  602.  *
  603.  *   METHOD: wpDraggedOverObject                            ( ) PRIVATE
  604.  *                                                          (X) PUBLIC
  605.  *   DESCRIPTION:
  606.  *
  607.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  608.  *
  609.  */
  610.  
  611. SOM_Scope MRESULT   SOMLINK wpstut_wpDraggedOverObject(WPSTutorial *somSelf,
  612.                 WPObject *DraggedOverObject)
  613. {
  614.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  615.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDraggedOverObject");
  616.  
  617.     DisplayMethodInfo(IDS_WPDRAGGEDOVEROBJECT);
  618.  
  619.     return (parent_wpDraggedOverObject(somSelf,DraggedOverObject));
  620. }
  621.  
  622. /*
  623.  *
  624.  *   METHOD: wpDragOver                                     ( ) PRIVATE
  625.  *                                                          (X) PUBLIC
  626.  *   DESCRIPTION:
  627.  *
  628.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  629.  *
  630.  */
  631.  
  632. SOM_Scope MRESULT   SOMLINK wpstut_wpDragOver(WPSTutorial *somSelf,
  633.                 HWND hwndCnr,
  634.                 PDRAGINFO pdrgInfo)
  635. {
  636.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  637.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDragOver");
  638.  
  639.     DisplayMethodInfo(IDS_WPDRAGOVER);
  640.  
  641.     return (parent_wpDragOver(somSelf,hwndCnr,pdrgInfo));
  642. }
  643.  
  644. /*
  645.  *
  646.  *   METHOD: wpDrop                                         ( ) PRIVATE
  647.  *                                                          (X) PUBLIC
  648.  *   DESCRIPTION:
  649.  *
  650.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  651.  *
  652.  */
  653.  
  654. SOM_Scope MRESULT   SOMLINK wpstut_wpDrop(WPSTutorial *somSelf,
  655.                 HWND hwndCnr,
  656.                 PDRAGINFO pdrgInfo,
  657.                 PDRAGITEM pdrgItem)
  658. {
  659.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  660.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDrop");
  661.  
  662.     DisplayMethodInfo(IDS_WPDROP);
  663.  
  664.     return (parent_wpDrop(somSelf,hwndCnr,pdrgInfo,pdrgItem));
  665. }
  666.  
  667. /*
  668.  *
  669.  *   METHOD: wpDroppedOnObject                              ( ) PRIVATE
  670.  *                                                          (X) PUBLIC
  671.  *   DESCRIPTION:
  672.  *
  673.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  674.  *
  675.  */
  676.  
  677. SOM_Scope BOOL   SOMLINK wpstut_wpDroppedOnObject(WPSTutorial *somSelf,
  678.                 WPObject *DroppedOnObject)
  679. {
  680.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  681.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpDroppedOnObject");
  682.  
  683.     DisplayMethodInfo(IDS_WPDROPPEDONOBJECT);
  684.  
  685.     return (parent_wpDroppedOnObject(somSelf,DroppedOnObject));
  686. }
  687.  
  688. /*
  689.  *
  690.  *   METHOD: wpEndConversation                              ( ) PRIVATE
  691.  *                                                          (X) PUBLIC
  692.  *   DESCRIPTION:
  693.  *
  694.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  695.  *
  696.  */
  697.  
  698. SOM_Scope MRESULT   SOMLINK wpstut_wpEndConversation(WPSTutorial *somSelf,
  699.                 ULONG ulItemID,
  700.                 ULONG flResult)
  701. {
  702.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  703.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpEndConversation");
  704.  
  705.     DisplayMethodInfo(IDS_WPENDCONVERSATION);
  706.  
  707.     return (parent_wpEndConversation(somSelf,ulItemID,flResult));
  708. }
  709.  
  710. /*
  711.  *
  712.  *   METHOD: wpFilterPopupMenu                              ( ) PRIVATE
  713.  *                                                          (X) PUBLIC
  714.  *   DESCRIPTION:
  715.  *
  716.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  717.  *
  718.  */
  719.  
  720. SOM_Scope ULONG   SOMLINK wpstut_wpFilterPopupMenu(WPSTutorial *somSelf,
  721.                 ULONG ulFlags,
  722.                 HWND hwndCnr,
  723.                 BOOL fMultiSelect)
  724. {
  725.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  726.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpFilterPopupMenu");
  727.  
  728.     DisplayMethodInfo(IDS_WPFILTERPOPUPMENU);
  729.  
  730.     return (parent_wpFilterPopupMenu(somSelf,ulFlags,hwndCnr,fMultiSelect));
  731. }
  732.  
  733. /*
  734.  *
  735.  *   METHOD: wpFindUseItem                                  ( ) PRIVATE
  736.  *                                                          (X) PUBLIC
  737.  *   DESCRIPTION:
  738.  *
  739.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  740.  *
  741.  */
  742.  
  743. SOM_Scope PUSEITEM   SOMLINK wpstut_wpFindUseItem(WPSTutorial *somSelf,
  744.                 ULONG type,
  745.                 PUSEITEM pCurrentItem)
  746. {
  747.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  748.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpFindUseItem");
  749.  
  750.     DisplayMethodInfo(IDS_WPFINDUSEITEM);
  751.  
  752.     return (parent_wpFindUseItem(somSelf,type,pCurrentItem));
  753. }
  754.  
  755. /*
  756.  *
  757.  *   METHOD: wpFormatDragItem                               ( ) PRIVATE
  758.  *                                                          (X) PUBLIC
  759.  *   DESCRIPTION:
  760.  *
  761.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  762.  *
  763.  */
  764.  
  765. SOM_Scope BOOL   SOMLINK wpstut_wpFormatDragItem(WPSTutorial *somSelf,
  766.                 PDRAGITEM pdrgItem)
  767. {
  768.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  769.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpFormatDragItem");
  770.  
  771.     DisplayMethodInfo(IDS_WPFORMATDRAGITEM);
  772.  
  773.     return (parent_wpFormatDragItem(somSelf,pdrgItem));
  774. }
  775.  
  776. /*
  777.  *
  778.  *   METHOD: wpFree                                         ( ) PRIVATE
  779.  *                                                          (X) PUBLIC
  780.  *   DESCRIPTION:
  781.  *
  782.  *     This method is overridden to disconnect and close the named pipe
  783.  *     created to communicate with the 'Show Method Description'
  784.  *     (SHOWDESC.EXE) program.  This method also kills that program.
  785.  *
  786.  */
  787.  
  788. SOM_Scope BOOL   SOMLINK wpstut_wpFree(WPSTutorial *somSelf)
  789. {
  790.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  791.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpFree");
  792.  
  793.     /*
  794.     **  Disconnect and close the pipe used to communicate with the
  795.     **  'Show Method Description' program.
  796.     */
  797.     DosDisConnectNPipe(hNPipe);
  798.     DosClose(hNPipe);
  799.  
  800.     /*
  801.     **  Kill the 'Show Method Description' process.
  802.     */
  803.     DosKillProcess(DKP_PROCESSTREE, ShowMethDescPID);
  804.  
  805.     return (parent_wpFree(somSelf));
  806. }
  807.  
  808. /*
  809.  *
  810.  *   METHOD: wpFreeMem                                      ( ) PRIVATE
  811.  *                                                          (X) PUBLIC
  812.  *   DESCRIPTION:
  813.  *
  814.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  815.  *
  816.  */
  817.  
  818. SOM_Scope BOOL   SOMLINK wpstut_wpFreeMem(WPSTutorial *somSelf,
  819.                 PBYTE pByte)
  820. {
  821.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  822.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpFreeMem");
  823.  
  824.     DisplayMethodInfo(IDS_WPFREEMEM);
  825.  
  826.     return (parent_wpFreeMem(somSelf,pByte));
  827. }
  828.  
  829. /*
  830.  *
  831.  *   METHOD: wpHide                                         ( ) PRIVATE
  832.  *                                                          (X) PUBLIC
  833.  *   DESCRIPTION:
  834.  *
  835.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  836.  *
  837.  */
  838.  
  839. SOM_Scope BOOL   SOMLINK wpstut_wpHide(WPSTutorial *somSelf)
  840. {
  841.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  842.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpHide");
  843.  
  844.     DisplayMethodInfo(IDS_WPHIDE);
  845.  
  846.     return (parent_wpHide(somSelf));
  847. }
  848.  
  849. /*
  850.  *
  851.  *   METHOD: wpInitData                                     ( ) PRIVATE
  852.  *                                                          (X) PUBLIC
  853.  *   DESCRIPTION:
  854.  *
  855.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  856.  *
  857.  */
  858.  
  859. SOM_Scope void   SOMLINK wpstut_wpInitData(WPSTutorial *somSelf)
  860. {
  861.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  862.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpInitData");
  863.  
  864.     DisplayMethodInfo(IDS_WPINITDATA);
  865.  
  866.     parent_wpInitData(somSelf);
  867. }
  868.  
  869. /*
  870.  *
  871.  *   METHOD: wpInsertPopupMenuItems                         ( ) PRIVATE
  872.  *                                                          (X) PUBLIC
  873.  *   DESCRIPTION:
  874.  *
  875.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  876.  *
  877.  */
  878.  
  879. SOM_Scope BOOL   SOMLINK wpstut_wpInsertPopupMenuItems(WPSTutorial *somSelf,
  880.                 HWND hwndMenu,
  881.                 ULONG iPosition,
  882.                 HMODULE hmod,
  883.                 ULONG MenuID,
  884.                 ULONG SubMenuID)
  885. {
  886.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  887.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpInsertPopupMenuItems");
  888.  
  889.     DisplayMethodInfo(IDS_WPINSERTPOPUPMENUITEMS);
  890.  
  891.     return (parent_wpInsertPopupMenuItems(somSelf,hwndMenu,iPosition,hmod,MenuID,SubMenuID));
  892. }
  893.  
  894. /*
  895.  *
  896.  *   METHOD: wpInsertSettingsPage                           ( ) PRIVATE
  897.  *                                                          (X) PUBLIC
  898.  *   DESCRIPTION:
  899.  *
  900.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  901.  *
  902.  */
  903.  
  904. SOM_Scope ULONG   SOMLINK wpstut_wpInsertSettingsPage(WPSTutorial *somSelf,
  905.                 HWND hwndNotebook,
  906.                 PPAGEINFO ppageinfo)
  907. {
  908.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  909.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpInsertSettingsPage");
  910.  
  911.     DisplayMethodInfo(IDS_WPINSERTSETTINGSPAGE);
  912.  
  913.     return (parent_wpInsertSettingsPage(somSelf,hwndNotebook,ppageinfo));
  914. }
  915.  
  916. /*
  917.  *
  918.  *   METHOD: wpMenuItemSelected                             ( ) PRIVATE
  919.  *                                                          (X) PUBLIC
  920.  *   DESCRIPTION:
  921.  *
  922.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  923.  *     In addition, this method processes the input from the
  924.  *     "Open tutorial" menu item added by this class.
  925.  *
  926.  */
  927.  
  928. SOM_Scope BOOL   SOMLINK wpstut_wpMenuItemSelected(WPSTutorial *somSelf,
  929.                 HWND hwndFrame,
  930.                 ULONG ulMenuId)
  931. {
  932.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  933.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpMenuItemSelected");
  934.  
  935.     DisplayMethodInfo(IDS_WPMENUITEMSELECTED);
  936.  
  937.     /*
  938.     **  Determine which menu item in the context menu was selected.
  939.     */
  940.     switch ( ulMenuId )
  941.     {
  942.        case IDM_OPENTUT:
  943.        {
  944.           /*
  945.           **   The new 'Open tutorial' menu item was selected.
  946.           **   We could call 'wpOpen' here, but if the object is already
  947.           **   opened, the following API determines whether the object
  948.           **   should be resurfaced or opened.  (If 'wpOpen' is called
  949.           **   instead, multiple concurrent views won't work.)
  950.           */
  951.           _wpViewObject(somSelf, NULLHANDLE, OPEN_TUTORIAL, 0);
  952.           break;
  953.        }
  954.  
  955.        default :
  956.        {
  957.           /*
  958.           **  The parent can handle all other menu item selections.
  959.           */
  960.           return parent_wpMenuItemSelected(somSelf, hwndFrame, ulMenuId);
  961.        }
  962.     }
  963.  
  964.     /*
  965.     **  Indicate successful completion.
  966.     */
  967.     return TRUE;
  968. }
  969.  
  970. /*
  971.  *
  972.  *  METHOD: wpModifyPopupMenu                              ( ) PRIVATE
  973.  *                                                         (X) PUBLIC
  974.  *  DESCRIPTION:
  975.  *
  976.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  977.  *     In addition, this method adds the "Open tutorial" item to the
  978.  *     "Open" menu of the object's context menu,
  979.  *
  980.  */
  981.  
  982. SOM_Scope BOOL   SOMLINK wpstut_wpModifyPopupMenu(WPSTutorial *somSelf,
  983.                 HWND hwndMenu,
  984.                 HWND hwndCnr,
  985.                 ULONG iPosition)
  986. {
  987.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  988.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpModifyPopupMenu");
  989.  
  990.     DisplayMethodInfo(IDS_WPMODIFYPOPUPMENU);
  991.  
  992.     /*
  993.     **  Insert the "Open tutorial" menu item at the top of the "Open"
  994.     **  submenu.
  995.     */
  996.     _wpInsertPopupMenuItems(somSelf,
  997.                             hwndMenu,
  998.                             0,
  999.                             hmod,
  1000.                             ID_OPENMENU,
  1001.                             WPMENUID_OPEN);
  1002.  
  1003.     /*
  1004.     **  Invoke default processing.
  1005.     */
  1006.     return (parent_wpModifyPopupMenu(somSelf, hwndMenu, hwndCnr, iPosition));
  1007. }
  1008.  
  1009. /*
  1010.  *
  1011.  *   METHOD: wpOpen                                         ( ) PRIVATE
  1012.  *                                                          (X) PUBLIC
  1013.  *   DESCRIPTION:
  1014.  *
  1015.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1016.  *     In addition, this method displays the current open view for the
  1017.  *     object.  If no view is open, a new open view is created.
  1018.  *
  1019.  */
  1020.  
  1021. SOM_Scope HWND   SOMLINK wpstut_wpOpen(WPSTutorial *somSelf,
  1022.                 HWND hwndCnr,
  1023.                 ULONG ulView,
  1024.                 ULONG param)
  1025. {
  1026.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1027.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpOpen");
  1028.  
  1029.     DisplayMethodInfo(IDS_WPOPEN);
  1030.  
  1031.     /*
  1032.     **  Determine which view is to be shown.
  1033.     */
  1034.     switch (ulView)
  1035.     {
  1036.        case OPEN_TUTORIAL:
  1037.  
  1038.           /*
  1039.           **  The user wants to see the "Open tutorial" view, so we'll try to
  1040.           **  give focus to an already open view.
  1041.           */
  1042.           if (!_wpSwitchTo(somSelf, ulView))
  1043.           {
  1044.              /*
  1045.              **  There is no open view, so a view needs to be created for
  1046.              **  this instance.
  1047.              */
  1048.              return _DisplayTitleInfo(somSelf);
  1049.           }
  1050.           break;
  1051.  
  1052.        default:
  1053.           return parent_wpOpen(somSelf, hwndCnr, ulView, param);
  1054.     }
  1055. }
  1056.  
  1057. /*
  1058.  *
  1059.  *   METHOD: wpQueryConfirmations                           ( ) PRIVATE
  1060.  *                                                          (X) PUBLIC
  1061.  *   DESCRIPTION:
  1062.  *
  1063.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1064.  *
  1065.  */
  1066.  
  1067. SOM_Scope ULONG   SOMLINK wpstut_wpQueryConfirmations(WPSTutorial *somSelf)
  1068. {
  1069.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1070.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryConfirmations");
  1071.  
  1072.     DisplayMethodInfo(IDS_WPQUERYCONFIRMATIONS);
  1073.  
  1074.     return (parent_wpQueryConfirmations(somSelf));
  1075. }
  1076.  
  1077. /*
  1078.  *
  1079.  *   METHOD: wpQueryDefaultView                             ( ) PRIVATE
  1080.  *                                                          (X) PUBLIC
  1081.  *   DESCRIPTION:
  1082.  *
  1083.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1084.  *
  1085.  */
  1086.  
  1087. SOM_Scope ULONG   SOMLINK wpstut_wpQueryDefaultView(WPSTutorial *somSelf)
  1088. {
  1089.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1090.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryDefaultView");
  1091.  
  1092.     DisplayMethodInfo(IDS_WPQUERYDEFAULTVIEW);
  1093.  
  1094.     return (parent_wpQueryDefaultView(somSelf));
  1095. }
  1096.  
  1097. /*
  1098.  *
  1099.  *   METHOD: wpQueryDetailsData                             ( ) PRIVATE
  1100.  *                                                          (X) PUBLIC
  1101.  *   DESCRIPTION:
  1102.  *
  1103.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1104.  *
  1105.  */
  1106.  
  1107. SOM_Scope ULONG   SOMLINK wpstut_wpQueryDetailsData(WPSTutorial *somSelf,
  1108.                 PVOID *ppDetailsData,
  1109.                 PULONG pcp)
  1110. {
  1111.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1112.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryDetailsData");
  1113.  
  1114.     DisplayMethodInfo(IDS_WPQUERYDETAILSDATA);
  1115.  
  1116.     return (parent_wpQueryDetailsData(somSelf,ppDetailsData,pcp));
  1117. }
  1118.  
  1119. /*
  1120.  *
  1121.  *   METHOD: wpQueryHandle                                  ( ) PRIVATE
  1122.  *                                                          (X) PUBLIC
  1123.  *   DESCRIPTION:
  1124.  *
  1125.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1126.  *
  1127.  */
  1128.  
  1129. SOM_Scope HOBJECT   SOMLINK wpstut_wpQueryHandle(WPSTutorial *somSelf)
  1130. {
  1131.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1132.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryHandle");
  1133.  
  1134.     DisplayMethodInfo(IDS_WPQUERYHANDLE);
  1135.  
  1136.     return (parent_wpQueryHandle(somSelf));
  1137. }
  1138.  
  1139. /*
  1140.  *
  1141.  *   METHOD: wpQueryIcon                                    ( ) PRIVATE
  1142.  *                                                          (X) PUBLIC
  1143.  *   DESCRIPTION:
  1144.  *
  1145.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1146.  *
  1147.  */
  1148.  
  1149. SOM_Scope HPOINTER   SOMLINK wpstut_wpQueryIcon(WPSTutorial *somSelf)
  1150. {
  1151.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1152.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryIcon");
  1153.  
  1154.     DisplayMethodInfo(IDS_WPQUERYICON);
  1155.  
  1156.     return (parent_wpQueryIcon(somSelf));
  1157. }
  1158.  
  1159. /*
  1160.  *
  1161.  *   METHOD: wpQueryIconData                                ( ) PRIVATE
  1162.  *                                                          (X) PUBLIC
  1163.  *   DESCRIPTION:
  1164.  *
  1165.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1166.  *
  1167.  */
  1168.  
  1169. SOM_Scope ULONG   SOMLINK wpstut_wpQueryIconData(WPSTutorial *somSelf,
  1170.                 PICONINFO pIconInfo)
  1171. {
  1172.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1173.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryIconData");
  1174.  
  1175.     DisplayMethodInfo(IDS_WPQUERYICONDATA);
  1176.  
  1177.     return (parent_wpQueryIconData(somSelf,pIconInfo));
  1178. }
  1179.  
  1180. /*
  1181.  *
  1182.  *   METHOD: wpQueryRealName                                ( ) PRIVATE
  1183.  *                                                          (X) PUBLIC
  1184.  *   DESCRIPTION:
  1185.  *
  1186.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1187.  *
  1188.  */
  1189.  
  1190. SOM_Scope BOOL   SOMLINK wpstut_wpQueryRealName(WPSTutorial *somSelf,
  1191.                 PSZ pszFilename,
  1192.                 PULONG pcb,
  1193.                 BOOL fQualified)
  1194. {
  1195.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1196.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryRealName");
  1197.  
  1198.     DisplayMethodInfo(IDS_WPQUERYREALNAME);
  1199.  
  1200.     return (parent_wpQueryRealName(somSelf,pszFilename,pcb,fQualified));
  1201. }
  1202.  
  1203. /*
  1204.  *
  1205.  *   METHOD: wpQueryStyle                                   ( ) PRIVATE
  1206.  *                                                          (X) PUBLIC
  1207.  *   DESCRIPTION:
  1208.  *
  1209.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1210.  *
  1211.  */
  1212.  
  1213. SOM_Scope ULONG   SOMLINK wpstut_wpQueryStyle(WPSTutorial *somSelf)
  1214. {
  1215.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1216.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryStyle");
  1217.  
  1218.     DisplayMethodInfo(IDS_WPQUERYSTYLE);
  1219.  
  1220.     return (parent_wpQueryStyle(somSelf));
  1221. }
  1222.  
  1223. /*
  1224.  *
  1225.  *   METHOD: wpQueryTitle                                   ( ) PRIVATE
  1226.  *                                                          (X) PUBLIC
  1227.  *   DESCRIPTION:
  1228.  *
  1229.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1230.  *
  1231.  */
  1232.  
  1233. SOM_Scope PSZ   SOMLINK wpstut_wpQueryTitle(WPSTutorial *somSelf)
  1234. {
  1235.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1236.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryTitle");
  1237.  
  1238.     DisplayMethodInfo(IDS_WPQUERYTITLE);
  1239.  
  1240.     return (parent_wpQueryTitle(somSelf));
  1241. }
  1242.  
  1243. /*
  1244.  *
  1245.  *   METHOD: wpQueryType                                    ( ) PRIVATE
  1246.  *                                                          (X) PUBLIC
  1247.  *   DESCRIPTION:
  1248.  *
  1249.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1250.  *
  1251.  */
  1252.  
  1253. SOM_Scope PSZ   SOMLINK wpstut_wpQueryType(WPSTutorial *somSelf)
  1254. {
  1255.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1256.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpQueryType");
  1257.  
  1258.     DisplayMethodInfo(IDS_WPQUERYTYPE);
  1259.  
  1260.     return (parent_wpQueryType(somSelf));
  1261. }
  1262.  
  1263. /*
  1264.  *
  1265.  *   METHOD: wpRegisterView                                 ( ) PRIVATE
  1266.  *                                                          (X) PUBLIC
  1267.  *   DESCRIPTION:
  1268.  *
  1269.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1270.  *
  1271.  */
  1272.  
  1273. SOM_Scope BOOL   SOMLINK wpstut_wpRegisterView(WPSTutorial *somSelf,
  1274.                 HWND hwndFrame,
  1275.                 PSZ pszViewTitle)
  1276. {
  1277.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1278.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRegisterView");
  1279.  
  1280.     DisplayMethodInfo(IDS_WPREGISTERVIEW);
  1281.  
  1282.     return (parent_wpRegisterView(somSelf,hwndFrame,pszViewTitle));
  1283. }
  1284.  
  1285. /*
  1286.  *
  1287.  *   METHOD: wpRender                                       ( ) PRIVATE
  1288.  *                                                          (X) PUBLIC
  1289.  *   DESCRIPTION:
  1290.  *
  1291.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1292.  *
  1293.  */
  1294.  
  1295. SOM_Scope MRESULT   SOMLINK wpstut_wpRender(WPSTutorial *somSelf,
  1296.                 PDRAGTRANSFER pdxfer)
  1297. {
  1298.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1299.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRender");
  1300.  
  1301.     DisplayMethodInfo(IDS_WPRENDER);
  1302.  
  1303.     return (parent_wpRender(somSelf,pdxfer));
  1304. }
  1305.  
  1306. /*
  1307.  *
  1308.  *   METHOD: wpRenderComplete                               ( ) PRIVATE
  1309.  *                                                          (X) PUBLIC
  1310.  *   DESCRIPTION:
  1311.  *
  1312.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1313.  *
  1314.  */
  1315.  
  1316. SOM_Scope MRESULT   SOMLINK wpstut_wpRenderComplete(WPSTutorial *somSelf,
  1317.                 PDRAGTRANSFER pdxfer,
  1318.                 ULONG ulResult)
  1319. {
  1320.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1321.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRenderComplete");
  1322.  
  1323.     DisplayMethodInfo(IDS_WPRENDERCOMPLETE);
  1324.  
  1325.     return (parent_wpRenderComplete(somSelf,pdxfer,ulResult));
  1326. }
  1327.  
  1328. /*
  1329.  *
  1330.  *   METHOD: wpRestore                                      ( ) PRIVATE
  1331.  *                                                          (X) PUBLIC
  1332.  *   DESCRIPTION:
  1333.  *
  1334.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1335.  *
  1336.  */
  1337.  
  1338. SOM_Scope BOOL   SOMLINK wpstut_wpRestore(WPSTutorial *somSelf)
  1339. {
  1340.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1341.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRestore");
  1342.  
  1343.     DisplayMethodInfo(IDS_WPRESTORE);
  1344.  
  1345.     return (parent_wpRestore(somSelf));
  1346. }
  1347.  
  1348. /*
  1349.  *
  1350.  *   METHOD: wpRestoreData                                  ( ) PRIVATE
  1351.  *                                                          (X) PUBLIC
  1352.  *   DESCRIPTION:
  1353.  *
  1354.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1355.  *
  1356.  */
  1357.  
  1358. SOM_Scope BOOL   SOMLINK wpstut_wpRestoreData(WPSTutorial *somSelf,
  1359.                 PSZ pszClass,
  1360.                 ULONG ulKey,
  1361.                 PBYTE pValue,
  1362.                 PULONG pcbValue)
  1363. {
  1364.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1365.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRestoreData");
  1366.  
  1367.     DisplayMethodInfo(IDS_WPRESTOREDATA);
  1368.  
  1369.     return (parent_wpRestoreData(somSelf,pszClass,ulKey,pValue,pcbValue));
  1370. }
  1371.  
  1372. /*
  1373.  *
  1374.  *   METHOD: wpRestoreLong                                  ( ) PRIVATE
  1375.  *                                                          (X) PUBLIC
  1376.  *   DESCRIPTION:
  1377.  *
  1378.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1379.  *
  1380.  */
  1381.  
  1382. SOM_Scope BOOL   SOMLINK wpstut_wpRestoreLong(WPSTutorial *somSelf,
  1383.                 PSZ pszClass,
  1384.                 ULONG ulKey,
  1385.                 PULONG pulValue)
  1386. {
  1387.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1388.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRestoreLong");
  1389.  
  1390.     DisplayMethodInfo(IDS_WPRESTORELONG);
  1391.  
  1392.     return (parent_wpRestoreLong(somSelf,pszClass,ulKey,pulValue));
  1393. }
  1394.  
  1395. /*
  1396.  *
  1397.  *  METHOD: wpRestoreState                                 ( ) PRIVATE
  1398.  *                                                         (X) PUBLIC
  1399.  *  DESCRIPTION:
  1400.  *
  1401.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1402.  *     In addition, this method queries the title to "force" all views of
  1403.  *     the object's title to be backwards upon IPL.
  1404.  */
  1405.  
  1406. SOM_Scope BOOL   SOMLINK wpstut_wpRestoreState(WPSTutorial *somSelf,
  1407.                 ULONG ulReserved)
  1408. {
  1409.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1410.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRestoreState");
  1411.  
  1412.     DisplayMethodInfo(IDS_WPRESTORESTATE);
  1413.  
  1414.     /*
  1415.     **  Reset the title so it isn't the reverse of the reverse (i.e. normal).
  1416.     */
  1417.     _wpSetTitle(somSelf, _wpQueryTitle(somSelf));
  1418.  
  1419.     return (parent_wpRestoreState(somSelf,ulReserved));
  1420. }
  1421.  
  1422. /*
  1423.  *
  1424.  *   METHOD: wpRestoreString                                ( ) PRIVATE
  1425.  *                                                          (X) PUBLIC
  1426.  *   DESCRIPTION:
  1427.  *
  1428.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1429.  *
  1430.  */
  1431.  
  1432. SOM_Scope BOOL   SOMLINK wpstut_wpRestoreString(WPSTutorial *somSelf,
  1433.                 PSZ pszClass,
  1434.                 ULONG ulKey,
  1435.                 PSZ pszValue,
  1436.                 PULONG pcbValue)
  1437. {
  1438.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1439.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpRestoreString");
  1440.  
  1441.     DisplayMethodInfo(IDS_WPRESTORESTRING);
  1442.  
  1443.     return (parent_wpRestoreString(somSelf,pszClass,ulKey,pszValue,pcbValue));
  1444. }
  1445.  
  1446. /*
  1447.  *
  1448.  *   METHOD: wpSaveData                                     ( ) PRIVATE
  1449.  *                                                          (X) PUBLIC
  1450.  *   DESCRIPTION:
  1451.  *
  1452.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1453.  *
  1454.  */
  1455.  
  1456. SOM_Scope BOOL   SOMLINK wpstut_wpSaveData(WPSTutorial *somSelf,
  1457.                 PSZ pszClass,
  1458.                 ULONG ulKey,
  1459.                 PBYTE pValue,
  1460.                 ULONG cbValue)
  1461. {
  1462.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1463.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSaveData");
  1464.  
  1465.     DisplayMethodInfo(IDS_WPSAVEDATA);
  1466.  
  1467.     return (parent_wpSaveData(somSelf,pszClass,ulKey,pValue,cbValue));
  1468. }
  1469.  
  1470. /*
  1471.  *
  1472.  *   METHOD: wpSaveDeferred                                 ( ) PRIVATE
  1473.  *                                                          (X) PUBLIC
  1474.  *   DESCRIPTION:
  1475.  *
  1476.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1477.  *
  1478.  */
  1479.  
  1480. SOM_Scope BOOL   SOMLINK wpstut_wpSaveDeferred(WPSTutorial *somSelf)
  1481. {
  1482.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1483.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSaveDeferred");
  1484.  
  1485.     DisplayMethodInfo(IDS_WPSAVEDEFERRED);
  1486.  
  1487.     return (parent_wpSaveDeferred(somSelf));
  1488. }
  1489.  
  1490. /*
  1491.  *
  1492.  *   METHOD: wpSaveImmediate                                ( ) PRIVATE
  1493.  *                                                          (X) PUBLIC
  1494.  *   DESCRIPTION:
  1495.  *
  1496.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1497.  *
  1498.  */
  1499.  
  1500. SOM_Scope BOOL   SOMLINK wpstut_wpSaveImmediate(WPSTutorial *somSelf)
  1501. {
  1502.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1503.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSaveImmediate");
  1504.  
  1505.     DisplayMethodInfo(IDS_WPSAVEIMMEDIATE);
  1506.  
  1507.     return (parent_wpSaveImmediate(somSelf));
  1508. }
  1509.  
  1510. /*
  1511.  *
  1512.  *   METHOD: wpSaveLong                                     ( ) PRIVATE
  1513.  *                                                          (X) PUBLIC
  1514.  *   DESCRIPTION:
  1515.  *
  1516.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1517.  *
  1518.  */
  1519.  
  1520. SOM_Scope BOOL   SOMLINK wpstut_wpSaveLong(WPSTutorial *somSelf,
  1521.                 PSZ pszClass,
  1522.                 ULONG ulKey,
  1523.                 ULONG ulValue)
  1524. {
  1525.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1526.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSaveLong");
  1527.  
  1528.     DisplayMethodInfo(IDS_WPSAVELONG);
  1529.  
  1530.     return (parent_wpSaveLong(somSelf,pszClass,ulKey,ulValue));
  1531. }
  1532.  
  1533. /*
  1534.  *
  1535.  *   METHOD: wpSaveState                                    ( ) PRIVATE
  1536.  *                                                          (X) PUBLIC
  1537.  *   DESCRIPTION:
  1538.  *
  1539.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1540.  *
  1541.  */
  1542.  
  1543. SOM_Scope BOOL   SOMLINK wpstut_wpSaveState(WPSTutorial *somSelf)
  1544. {
  1545.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1546.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSaveState");
  1547.  
  1548.     DisplayMethodInfo(IDS_WPSAVESTATE);
  1549.  
  1550.     return (parent_wpSaveState(somSelf));
  1551. }
  1552.  
  1553. /*
  1554.  *
  1555.  *   METHOD: wpSaveString                                   ( ) PRIVATE
  1556.  *                                                          (X) PUBLIC
  1557.  *   DESCRIPTION:
  1558.  *
  1559.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1560.  *
  1561.  */
  1562.  
  1563. SOM_Scope BOOL   SOMLINK wpstut_wpSaveString(WPSTutorial *somSelf,
  1564.                 PSZ pszClass,
  1565.                 ULONG ulKey,
  1566.                 PSZ pszValue)
  1567. {
  1568.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1569.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSaveString");
  1570.  
  1571.     DisplayMethodInfo(IDS_WPSAVESTRING);
  1572.  
  1573.     return (parent_wpSaveString(somSelf,pszClass,ulKey,pszValue));
  1574. }
  1575.  
  1576. /*
  1577.  *
  1578.  *   METHOD: wpSetDefaultView                               ( ) PRIVATE
  1579.  *                                                          (X) PUBLIC
  1580.  *   DESCRIPTION:
  1581.  *
  1582.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1583.  *
  1584.  */
  1585.  
  1586. SOM_Scope BOOL   SOMLINK wpstut_wpSetDefaultView(WPSTutorial *somSelf,
  1587.                 ULONG ulView)
  1588. {
  1589.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1590.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetDefaultView");
  1591.  
  1592.     DisplayMethodInfo(IDS_WPSETDEFAULTVIEW);
  1593.  
  1594.     return (parent_wpSetDefaultView(somSelf,ulView));
  1595. }
  1596.  
  1597. /*
  1598.  *
  1599.  *   METHOD: wpSetIcon                                      ( ) PRIVATE
  1600.  *                                                          (X) PUBLIC
  1601.  *   DESCRIPTION:
  1602.  *
  1603.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1604.  *
  1605.  */
  1606.  
  1607. SOM_Scope BOOL   SOMLINK wpstut_wpSetIcon(WPSTutorial *somSelf,
  1608.                 HPOINTER hptrNewIcon)
  1609. {
  1610.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1611.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetIcon");
  1612.  
  1613.     DisplayMethodInfo(IDS_WPSETICON);
  1614.  
  1615.     return (parent_wpSetIcon(somSelf,hptrNewIcon));
  1616. }
  1617.  
  1618. /*
  1619.  *
  1620.  *   METHOD: wpSetIconData                                  ( ) PRIVATE
  1621.  *                                                          (X) PUBLIC
  1622.  *   DESCRIPTION:
  1623.  *
  1624.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1625.  *
  1626.  */
  1627.  
  1628. SOM_Scope BOOL   SOMLINK wpstut_wpSetIconData(WPSTutorial *somSelf,
  1629.                 PICONINFO pIconInfo)
  1630. {
  1631.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1632.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetIconData");
  1633.  
  1634.     DisplayMethodInfo(IDS_WPSETICONDATA);
  1635.  
  1636.     return (parent_wpSetIconData(somSelf,pIconInfo));
  1637. }
  1638.  
  1639. /*
  1640.  *
  1641.  *   METHOD: wpSetRealName                                  ( ) PRIVATE
  1642.  *                                                          (X) PUBLIC
  1643.  *   DESCRIPTION:
  1644.  *
  1645.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1646.  *
  1647.  */
  1648.  
  1649. SOM_Scope BOOL   SOMLINK wpstut_wpSetRealName(WPSTutorial *somSelf,
  1650.                 PSZ pszName)
  1651. {
  1652.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1653.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetRealName");
  1654.  
  1655.     DisplayMethodInfo(IDS_WPSETREALNAME);
  1656.  
  1657.     return (parent_wpSetRealName(somSelf,pszName));
  1658. }
  1659.  
  1660. /*
  1661.  *
  1662.  *   METHOD: wpSetStyle                                     ( ) PRIVATE
  1663.  *                                                          (X) PUBLIC
  1664.  *   DESCRIPTION:
  1665.  *
  1666.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1667.  *
  1668.  */
  1669.  
  1670. SOM_Scope BOOL   SOMLINK wpstut_wpSetStyle(WPSTutorial *somSelf,
  1671.                 ULONG ulNewStyle)
  1672. {
  1673.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1674.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetStyle");
  1675.  
  1676.     DisplayMethodInfo(IDS_WPSETSTYLE);
  1677.  
  1678.     return (parent_wpSetStyle(somSelf,ulNewStyle));
  1679. }
  1680.  
  1681. /*
  1682.  *
  1683.  *   METHOD: wpSetTitle                                     ( ) PRIVATE
  1684.  *                                                          (X) PUBLIC
  1685.  *   DESCRIPTION:
  1686.  *
  1687.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1688.  *     In addition, this method reverses the title supplied by
  1689.  *     the user.
  1690.  */
  1691.  
  1692. SOM_Scope BOOL   SOMLINK wpstut_wpSetTitle(WPSTutorial *somSelf,
  1693.                 PSZ pszNewTitle)
  1694. {
  1695.     CHAR szBackwardsTitle[CCHMAXPATHCOMP] = "";
  1696.                                     /* Buffer for backwards title            */
  1697.     int  i;                         /* Counter                               */
  1698.  
  1699.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1700.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetTitle");
  1701.  
  1702.     DisplayMethodInfo(IDS_WPSETTITLE);
  1703.  
  1704.     /*
  1705.     **  Reverse the title set by the user.
  1706.     */
  1707.     szBackwardsTitle[CCHMAXPATHCOMP-1] = '\0';
  1708.  
  1709.     for (i=(CCHMAXPATHCOMP-2);
  1710.          i!=0 && (*pszNewTitle != '\0');
  1711.          i--)
  1712.     {
  1713.        szBackwardsTitle[i] = *pszNewTitle;
  1714.        pszNewTitle++;
  1715.     }
  1716.  
  1717.     /*
  1718.     **  Return the backwards title.
  1719.     */
  1720.     return (parent_wpSetTitle(somSelf, (PSZ)&szBackwardsTitle[i+1]));
  1721. }
  1722.  
  1723. /*
  1724.  *
  1725.  *   METHOD: wpSetType                                      ( ) PRIVATE
  1726.  *                                                          (X) PUBLIC
  1727.  *   DESCRIPTION:
  1728.  *
  1729.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1730.  *
  1731.  */
  1732.  
  1733. SOM_Scope BOOL   SOMLINK wpstut_wpSetType(WPSTutorial *somSelf,
  1734.                 PSZ pszTypes,
  1735.                 PFEA2LIST pfeal)
  1736. {
  1737.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1738.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetType");
  1739.  
  1740.     DisplayMethodInfo(IDS_WPSETTYPE);
  1741.  
  1742.     return (parent_wpSetType(somSelf,pszTypes,pfeal));
  1743. }
  1744.  
  1745. /*
  1746.  *
  1747.  *  METHOD: wpSetup                                        ( ) PRIVATE
  1748.  *                                                         (X) PUBLIC
  1749.  *  DESCRIPTION:
  1750.  *
  1751.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1752.  *
  1753.  */
  1754.  
  1755. SOM_Scope BOOL   SOMLINK wpstut_wpSetup(WPSTutorial *somSelf,
  1756.                 PSZ pszSetupString)
  1757. {
  1758.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1759.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSetup");
  1760.  
  1761.     DisplayMethodInfo(IDS_WPSETUP);
  1762.  
  1763.     return (parent_wpSetup(somSelf,pszSetupString));
  1764. }
  1765.  
  1766. /*
  1767.  *
  1768.  *   METHOD: wpSwitchTo                                     ( ) PRIVATE
  1769.  *                                                          (X) PUBLIC
  1770.  *   DESCRIPTION:
  1771.  *
  1772.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1773.  *
  1774.  */
  1775.  
  1776. SOM_Scope BOOL   SOMLINK wpstut_wpSwitchTo(WPSTutorial *somSelf,
  1777.                 ULONG View)
  1778. {
  1779.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1780.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpSwitchTo");
  1781.  
  1782.     DisplayMethodInfo(IDS_WPSWITCHTO);
  1783.  
  1784.     return (parent_wpSwitchTo(somSelf,View));
  1785. }
  1786.  
  1787. /*
  1788.  *
  1789.  *   METHOD: wpUnlockObject                                 ( ) PRIVATE
  1790.  *                                                          (X) PUBLIC
  1791.  *   DESCRIPTION:
  1792.  *
  1793.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1794.  *
  1795.  */
  1796.  
  1797. SOM_Scope BOOL   SOMLINK wpstut_wpUnlockObject(WPSTutorial *somSelf)
  1798. {
  1799.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1800.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpUnlockObject");
  1801.  
  1802.     DisplayMethodInfo(IDS_WPUNLOCKOBJECT);
  1803.  
  1804.     return (parent_wpUnlockObject(somSelf));
  1805. }
  1806.  
  1807. /*
  1808.  *
  1809.  *   METHOD: wpUnInitData                                   ( ) PRIVATE
  1810.  *                                                          (X) PUBLIC
  1811.  *   DESCRIPTION:
  1812.  *
  1813.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1814.  *
  1815.  */
  1816.  
  1817. SOM_Scope void   SOMLINK wpstut_wpUnInitData(WPSTutorial *somSelf)
  1818. {
  1819.     /* WPSTutorialData *somThis = WPSTutorialGetData(somSelf); */
  1820.     WPSTutorialMethodDebug("WPSTutorial","wpstut_wpUnInitData");
  1821.  
  1822.     DisplayMethodInfo(IDS_WPUNINITDATA);
  1823.  
  1824.     parent_wpUnInitData(somSelf);
  1825. }
  1826.  
  1827. /**************************  CLASS METHODS SECTION  ***************************
  1828. *****                                                                     *****
  1829. *****              Do not put any code in this section unless             *****
  1830. *****                     it is an object CLASS method                    *****
  1831. *****                                                                     *****
  1832. ******************************************************************************/
  1833.  
  1834. #undef SOM_CurrentClass
  1835. #define SOM_CurrentClass SOMMeta
  1836.  
  1837.  
  1838. /*
  1839.  *
  1840.  *  METHOD: clsQueryModuleHandle
  1841.  *
  1842.  *  DESCRIPTION:
  1843.  *
  1844.  *    This method obtains and returns the module handle for the object class.
  1845.  *
  1846.  *  RETURN:
  1847.  *
  1848.  *    0        - Unsuccessful execution
  1849.  *    Non-zero - Module handle
  1850.  *
  1851.  */
  1852.  
  1853. SOM_Scope HMODULE SOMLINK wpstutM_clsQueryModuleHandle(M_WPSTutorial *somSelf)
  1854. {
  1855.     zString zsPathName;                /* Class DLL name                     */
  1856.     APIRET  rc;                        /* DosQueryModuleHandle return code   */
  1857.  
  1858.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  1859.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_clsQueryModuleHandle");
  1860.  
  1861.     /*
  1862.     **  We only need to initialize the module handle if it hasn't
  1863.     **  already been initialized!
  1864.     */
  1865.     if ( !hmod )
  1866.     {
  1867.        /*
  1868.        **  First, we need to locate the file that holds our class.
  1869.        */
  1870.        zsPathName = _somLocateClassFile( SOMClassMgrObject,
  1871.                                          SOM_IdFromString("WPSTutorial"),
  1872.                                          WPSTutorial_MajorVersion,
  1873.                                          WPSTutorial_MinorVersion);
  1874.  
  1875.        /*
  1876.        **  Now we can determine the module handle based on the name of the
  1877.        **  class.
  1878.        */
  1879.        rc = DosQueryModuleHandle(zsPathName, &hmod);
  1880.  
  1881.        if (rc)
  1882.        {
  1883.           /*
  1884.           **  The DLL handle could not be found.
  1885.           */
  1886.           DebugBox("wpstutM_clsQueryModuleHandle",
  1887.                    "Failed to load DLL resources");
  1888.  
  1889.           hmod = NULLHANDLE;
  1890.        }
  1891.     }
  1892.  
  1893.     return(hmod);
  1894. }
  1895.  
  1896.  
  1897. /*
  1898.  *
  1899.  *  METHOD: wpclsCreateDefaultTemplates
  1900.  *
  1901.  *  DESCRIPTION:
  1902.  *
  1903.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1904.  *
  1905.  */
  1906.  
  1907. SOM_Scope BOOL   SOMLINK wpstutM_wpclsCreateDefaultTemplates(M_WPSTutorial *somSelf,
  1908.                 WPObject *Folder)
  1909. {
  1910.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  1911.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsCreateDefaultTemplates");
  1912.  
  1913.     DisplayMethodInfo(IDS_WPCLSCREATEDEFAULTTEMPLATES);
  1914.  
  1915.     return (parent_wpclsCreateDefaultTemplates(somSelf,Folder));
  1916. }
  1917.  
  1918. /*
  1919.  *
  1920.  *  METHOD: wpclsFindObjectEnd
  1921.  *
  1922.  *  DESCRIPTION:
  1923.  *
  1924.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1925.  *
  1926.  */
  1927.  
  1928. SOM_Scope BOOL   SOMLINK wpstutM_wpclsFindObjectEnd(M_WPSTutorial *somSelf,
  1929.                 HFIND hFind)
  1930. {
  1931.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  1932.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsFindObjectEnd");
  1933.  
  1934.     DisplayMethodInfo(IDS_WPCLSFINDOBJECTEND);
  1935.  
  1936.     return (parent_wpclsFindObjectEnd(somSelf,hFind));
  1937. }
  1938.  
  1939. /*
  1940.  *
  1941.  *  METHOD: wpclsFindObjectFirst
  1942.  *
  1943.  *  DESCRIPTION:
  1944.  *
  1945.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1946.  *
  1947.  */
  1948.  
  1949. SOM_Scope BOOL   SOMLINK wpstutM_wpclsFindObjectFirst(M_WPSTutorial *somSelf,
  1950.                 PCLASS pClassList,
  1951.                 PHFIND phFind,
  1952.                 PSZ pszTitle,
  1953.                 WPFolder *Folder,
  1954.                 BOOL fSubfolders,
  1955.                 PVOID pExtendedCriteria,
  1956.                 POBJECT pBuffer,
  1957.                 PULONG pCount)
  1958. {
  1959.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  1960.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsFindObjectFirst");
  1961.  
  1962.     DisplayMethodInfo(IDS_WPCLSFINDOBJECTFIRST);
  1963.  
  1964.     return (parent_wpclsFindObjectFirst(somSelf,pClassList,phFind,pszTitle,Folder,fSubfolders,pExtendedCriteria,pBuffer,pCount));
  1965. }
  1966.  
  1967. /*
  1968.  *
  1969.  *  METHOD: wpclsFindObjectNext
  1970.  *
  1971.  *  DESCRIPTION:
  1972.  *
  1973.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1974.  *
  1975.  */
  1976.  
  1977. SOM_Scope BOOL   SOMLINK wpstutM_wpclsFindObjectNext(M_WPSTutorial *somSelf,
  1978.                 HFIND hFind,
  1979.                 POBJECT pBuffer,
  1980.                 PULONG pCount)
  1981. {
  1982.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  1983.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsFindObjectNext");
  1984.  
  1985.     DisplayMethodInfo(IDS_WPCLSFINDOBJECTNEXT);
  1986.  
  1987.     return (parent_wpclsFindObjectNext(somSelf,hFind,pBuffer,pCount));
  1988. }
  1989.  
  1990. /*
  1991.  *
  1992.  *  METHOD: wpclsInitData
  1993.  *
  1994.  *  DESCRIPTION:
  1995.  *
  1996.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  1997.  *     In addition, this method initializes the DLL module handle.
  1998.  */
  1999.  
  2000. SOM_Scope void   SOMLINK wpstutM_wpclsInitData(M_WPSTutorial *somSelf)
  2001. {
  2002.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2003.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsInitData");
  2004.  
  2005.     /*
  2006.     **  Call the parent method first.
  2007.     */
  2008.     parent_wpclsInitData(somSelf);
  2009.  
  2010.     /*
  2011.     **  We need to initialize the module handle for our DLL so that we can
  2012.     **  invoke 'DisplayMethodInfo'.
  2013.     */
  2014.     _clsQueryModuleHandle(somSelf);
  2015.  
  2016.     DisplayMethodInfo(IDS_WPCLSINITDATA);
  2017. }
  2018.  
  2019. /*
  2020.  *
  2021.  *  METHOD: wpclsMakeAwake
  2022.  *
  2023.  *  DESCRIPTION:
  2024.  *
  2025.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2026.  *
  2027.  */
  2028.  
  2029. SOM_Scope WPObject *  SOMLINK wpstutM_wpclsMakeAwake(M_WPSTutorial *somSelf,
  2030.                 PSZ pszTitle,
  2031.                 ULONG ulStyle,
  2032.                 HPOINTER hptrIcon,
  2033.                 POBJDATA pObjData,
  2034.                 WPFolder *Folder,
  2035.                 ULONG ulUser)
  2036. {
  2037.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2038.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsMakeAwake");
  2039.  
  2040.     DisplayMethodInfo(IDS_WPCLSMAKEAWAKE);
  2041.  
  2042.     return (parent_wpclsMakeAwake(somSelf,pszTitle,ulStyle,hptrIcon,pObjData,Folder,ulUser));
  2043. }
  2044.  
  2045. /*
  2046.  *
  2047.  *  METHOD: wpclsNew
  2048.  *
  2049.  *  DESCRIPTION:
  2050.  *
  2051.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2052.  *
  2053.  */
  2054.  
  2055. SOM_Scope WPObject *  SOMLINK wpstutM_wpclsNew(M_WPSTutorial *somSelf,
  2056.                 PSZ pszTitle,
  2057.                 PSZ pszSetupEnv,
  2058.                 WPFolder *Folder,
  2059.                 BOOL fLock)
  2060. {
  2061.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2062.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsNew");
  2063.  
  2064.     DisplayMethodInfo(IDS_WPCLSNEW);
  2065.  
  2066.     return (parent_wpclsNew(somSelf,pszTitle,pszSetupEnv,Folder,fLock));
  2067. }
  2068.  
  2069. /*
  2070.  *
  2071.  *  METHOD: wpclsQueryDefaultView
  2072.  *
  2073.  *  DESCRIPTION:
  2074.  *
  2075.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2076.  *     In addition, this method is overridden to make the default open
  2077.  *     view of the instances of this class to the "Open tutorial" view.
  2078.  */
  2079.  
  2080. SOM_Scope ULONG   SOMLINK wpstutM_wpclsQueryDefaultView(M_WPSTutorial *somSelf)
  2081. {
  2082.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2083.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryDefaultView");
  2084.  
  2085.     DisplayMethodInfo(IDS_WPCLSQUERYDEFAULTVIEW);
  2086.  
  2087.     /*
  2088.     **  Specify that the default open view for the instances of this class
  2089.     **  to be the "Open tutorial" view.
  2090.     */
  2091.     return OPEN_TUTORIAL;
  2092. }
  2093.  
  2094. /*
  2095.  *
  2096.  *  METHOD: wpclsQueryDetails
  2097.  *
  2098.  *  DESCRIPTION:
  2099.  *
  2100.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2101.  *
  2102.  */
  2103.  
  2104. SOM_Scope PCLASSDETAILS   SOMLINK wpstutM_wpclsQueryDetails(M_WPSTutorial *somSelf)
  2105. {
  2106.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2107.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryDetails");
  2108.  
  2109.     DisplayMethodInfo(IDS_WPCLSQUERYDETAILS);
  2110.  
  2111.     return (parent_wpclsQueryDetails(somSelf));
  2112. }
  2113.  
  2114. /*
  2115.  *
  2116.  *  METHOD: wpclsQueryDetailsInfo
  2117.  *
  2118.  *  DESCRIPTION:
  2119.  *
  2120.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2121.  *
  2122.  */
  2123.  
  2124. SOM_Scope ULONG   SOMLINK wpstutM_wpclsQueryDetailsInfo(M_WPSTutorial *somSelf,
  2125.                 PCLASSFIELDINFO *ppClassFieldInfo,
  2126.                 PULONG pSize)
  2127. {
  2128.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2129.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryDetailsInfo");
  2130.  
  2131.     DisplayMethodInfo(IDS_WPCLSQUERYDETAILSINFO);
  2132.  
  2133.     return (parent_wpclsQueryDetailsInfo(somSelf,ppClassFieldInfo,pSize));
  2134. }
  2135.  
  2136. /*
  2137.  *
  2138.  *  METHOD: wpclsQueryFolder
  2139.  *
  2140.  *  DESCRIPTION:
  2141.  *
  2142.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2143.  *
  2144.  */
  2145.  
  2146. SOM_Scope WPObject *  SOMLINK wpstutM_wpclsQueryFolder(M_WPSTutorial *somSelf,
  2147.                 PSZ pszLocation,
  2148.                 BOOL fLock)
  2149. {
  2150.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2151.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryFolder");
  2152.  
  2153.     DisplayMethodInfo(IDS_WPCLSQUERYFOLDER);
  2154.  
  2155.     return (parent_wpclsQueryFolder(somSelf,pszLocation,fLock));
  2156. }
  2157.  
  2158. /*
  2159.  *
  2160.  *  METHOD: wpclsQueryIcon
  2161.  *
  2162.  *  DESCRIPTION:
  2163.  *
  2164.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2165.  *
  2166.  */
  2167.  
  2168. SOM_Scope HPOINTER   SOMLINK wpstutM_wpclsQueryIcon(M_WPSTutorial *somSelf)
  2169. {
  2170.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2171.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryIcon");
  2172.  
  2173.     DisplayMethodInfo(IDS_WPCLSQUERYICON);
  2174.  
  2175.     return (parent_wpclsQueryIcon(somSelf));
  2176. }
  2177.  
  2178. /*
  2179.  *
  2180.  *  METHOD: wpclsQueryIconData                             ( ) PRIVATE
  2181.  *                                                         (X) PUBLIC
  2182.  *  DESCRIPTION:
  2183.  *
  2184.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2185.  *     In addition, the method is overridden to define the icon
  2186.  *     for the class.
  2187.  */
  2188.  
  2189. SOM_Scope ULONG   SOMLINK wpstutM_wpclsQueryIconData(M_WPSTutorial *somSelf,
  2190.                 PICONINFO pIconInfo)
  2191. {
  2192.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2193.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryIconData");
  2194.  
  2195.     DisplayMethodInfo(IDS_WPCLSQUERYICONDATA);
  2196.  
  2197.     /*
  2198.     **  Build the default icon for this class.
  2199.     */
  2200.     if (pIconInfo)
  2201.     {
  2202.        /*
  2203.        **  Fill in the icon information.  The icon resources is supplied
  2204.        **  in this DLL.
  2205.        */
  2206.        pIconInfo->fFormat = ICON_RESOURCE;
  2207.        pIconInfo->hmod = hmod;
  2208.        pIconInfo->resid = ID_ICON;
  2209.     }
  2210.  
  2211.     return (sizeof(ICONINFO));
  2212. }
  2213.  
  2214. /*
  2215.  *
  2216.  *  METHOD: wpclsQueryInstanceFilter
  2217.  *
  2218.  *  DESCRIPTION:
  2219.  *
  2220.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2221.  *
  2222.  */
  2223.  
  2224. SOM_Scope PSZ   SOMLINK wpstutM_wpclsQueryInstanceFilter(M_WPSTutorial *somSelf)
  2225. {
  2226.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2227.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryInstanceFilter");
  2228.  
  2229.     DisplayMethodInfo(IDS_WPCLSQUERYINSTANCEFILTER);
  2230.  
  2231.     return (parent_wpclsQueryInstanceFilter(somSelf));
  2232. }
  2233.  
  2234. /*
  2235.  *
  2236.  *  METHOD: wpclsQueryInstanceType
  2237.  *
  2238.  *  DESCRIPTION:
  2239.  *
  2240.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2241.  *
  2242.  */
  2243.  
  2244. SOM_Scope PSZ   SOMLINK wpstutM_wpclsQueryInstanceType(M_WPSTutorial *somSelf)
  2245. {
  2246.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2247.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryInstanceType");
  2248.  
  2249.     DisplayMethodInfo(IDS_WPCLSQUERYINSTANCETYPE);
  2250.  
  2251.     return (parent_wpclsQueryInstanceType(somSelf));
  2252. }
  2253.  
  2254. /*
  2255.  *
  2256.  *  METHOD: wpclsQueryObject
  2257.  *
  2258.  *  DESCRIPTION:
  2259.  *
  2260.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2261.  *
  2262.  */
  2263.  
  2264. SOM_Scope WPObject *  SOMLINK wpstutM_wpclsQueryObject(M_WPSTutorial *somSelf,
  2265.                 HOBJECT hObject)
  2266. {
  2267.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2268.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryObject");
  2269.  
  2270.     DisplayMethodInfo(IDS_WPCLSQUERYOBJECT);
  2271.  
  2272.     return (parent_wpclsQueryObject(somSelf,hObject));
  2273. }
  2274.  
  2275. /*
  2276.  *
  2277.  *  METHOD: wpclsQuerySettingsPageSize
  2278.  *
  2279.  *  DESCRIPTION:
  2280.  *
  2281.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2282.  *
  2283.  */
  2284.  
  2285. SOM_Scope BOOL   SOMLINK wpstutM_wpclsQuerySettingsPageSize(M_WPSTutorial *somSelf,
  2286.                 PSIZEL pSizl)
  2287. {
  2288.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2289.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQuerySettingsPageSize");
  2290.  
  2291.     DisplayMethodInfo(IDS_WPCLSQUERYSETTINGSPAGESIZE);
  2292.  
  2293.     return (parent_wpclsQuerySettingsPageSize(somSelf,pSizl));
  2294. }
  2295.  
  2296. /*
  2297.  *
  2298.  *  METHOD: wpclsQueryStyle
  2299.  *
  2300.  *  DESCRIPTION:
  2301.  *
  2302.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2303.  *
  2304.  */
  2305.  
  2306. SOM_Scope ULONG   SOMLINK wpstutM_wpclsQueryStyle(M_WPSTutorial *somSelf)
  2307. {
  2308.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2309.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryStyle");
  2310.  
  2311.     DisplayMethodInfo(IDS_WPCLSQUERYSTYLE);
  2312.  
  2313.     return (parent_wpclsQueryStyle(somSelf));
  2314. }
  2315.  
  2316. /*
  2317.  *
  2318.  *  METHOD: wpclsQueryTitle
  2319.  *
  2320.  *  DESCRIPTION:
  2321.  *
  2322.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2323.  *
  2324.  */
  2325.  
  2326. SOM_Scope PSZ   SOMLINK wpstutM_wpclsQueryTitle(M_WPSTutorial *somSelf)
  2327. {
  2328.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2329.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsQueryTitle");
  2330.  
  2331.     DisplayMethodInfo(IDS_WPCLSQUERYTITLE);
  2332.  
  2333.     return (parent_wpclsQueryTitle(somSelf));
  2334. }
  2335.  
  2336. /*
  2337.  *
  2338.  *  METHOD: wpclsUnInitData
  2339.  *
  2340.  *  DESCRIPTION:
  2341.  *
  2342.  *     This method is overridden to invoke 'DisplayMethodInfo'.
  2343.  *
  2344.  */
  2345.  
  2346. SOM_Scope void   SOMLINK wpstutM_wpclsUnInitData(M_WPSTutorial *somSelf)
  2347. {
  2348.     /* M_WPSTutorialData *somThis = M_WPSTutorialGetData(somSelf); */
  2349.     M_WPSTutorialMethodDebug("M_WPSTutorial","wpstutM_wpclsUnInitData");
  2350.  
  2351.     DisplayMethodInfo(IDS_WPCLSUNINITDATA);
  2352.  
  2353.     parent_wpclsUnInitData(somSelf);
  2354. }
  2355.  
  2356.  
  2357. /**************************  ORDINARY CODE SECTION  ***************************
  2358. *****                                                                     *****
  2359. *****                  Any non-method code should go here.                *****
  2360. *****                                                                     *****
  2361. ******************************************************************************/
  2362.  
  2363. #undef SOM_CurrentClass
  2364.  
  2365. /*
  2366.  *
  2367.  *  NAME: DisplayMethodInfo
  2368.  *
  2369.  *  DESCRIPTION:
  2370.  *
  2371.  *    This function communicates with the 'Show Method Description'
  2372.  *    (SHOWDESC.EXE) program using a named pipe.  This communication tells
  2373.  *    the other process to display the name and description of the specified
  2374.  *    method.
  2375.  *
  2376.  *    This function is invoked by most overridden methods.
  2377.  *
  2378.  *  RETURN:
  2379.  *
  2380.  *    NONE
  2381.  *
  2382.  */
  2383.  
  2384. VOID DisplayMethodInfo(ULONG ulMethodID)
  2385. {
  2386.    APIRET   rc = 0;              /* Return code for DosXXX API               */
  2387.    ULONG    ulAppType;           /* Application type                         */
  2388.    TID      tid;                 /* Thread ID for the created thread         */
  2389.    ULONG    ulBytesXferred;      /* Number of bytes transferred over the pipe*/
  2390.  
  2391.    /*
  2392.    **  If the thread used to start up the 'Show Method Description' program
  2393.    **  has not been started yet,  we'll create the thread.  We can also
  2394.    **  create the named pipe used to communicate with that program.
  2395.    */
  2396.    if ( !fProgramStarted )
  2397.    {
  2398.       /*
  2399.       **  First, we'll make sure that the 'Show Method Description'
  2400.       **  program is available for execution.  (If the program can't
  2401.       **  be executed, we'll get stuck waiting for the named pipe
  2402.       **  to "connect".)
  2403.       */
  2404.       rc = DosQueryAppType(DISPLAY_PROGRAM_NAME, &ulAppType);
  2405.  
  2406.       if ( rc )
  2407.       {
  2408.          WPSTutorialMethodDebug("DisplayMethodInfo",
  2409.                                 "SHOWDESC.EXE not available");
  2410.       }
  2411.       else
  2412.       {
  2413.          /*
  2414.          **  The program is available for execution, so we'll create the
  2415.          **  named pipe used to communicate with the program.
  2416.          */
  2417.          rc = DosCreateNPipe(PIPE_NAME,
  2418.                              &hNPipe,
  2419.                              NP_ACCESS_DUPLEX,
  2420.                              NP_WAIT | NP_TYPE_BYTE | NP_READMODE_BYTE |
  2421.                                NPIPE_COUNT,
  2422.                              4096,
  2423.                              4096,
  2424.                              10000);
  2425.  
  2426.          if ( rc )
  2427.          {
  2428.             WPSTutorialMethodDebug("DisplayMethodInfo", "DosCreateNPipe failed");
  2429.          }
  2430.          else
  2431.          {
  2432.             /*
  2433.             **  The thread will be created only if the named pipe was
  2434.             **  successfully created.
  2435.             */
  2436.             rc = DosCreateThread(&tid,
  2437.                                  (PFNTHREAD)DisplayMethodThread,
  2438.                                  0U,
  2439.                                  CREATE_READY,
  2440.                                  STACKSIZE);
  2441.             if ( rc )
  2442.             {
  2443.                /*
  2444.                **  Do clean up if the thread could not be created.
  2445.                */
  2446.                WPSTutorialMethodDebug("DisplayMethodInfo",
  2447.                                       "Thread could not be created");
  2448.                DosClose(hNPipe);
  2449.                fProgramStarted = FALSE;
  2450.             }
  2451.             else
  2452.             {
  2453.                fProgramStarted = TRUE;
  2454.  
  2455.                /*
  2456.                **  Connect the named pipe so the SHOWDESC.EXE program can open
  2457.                **  the pipe.
  2458.                */
  2459.                rc = DosConnectNPipe(hNPipe);
  2460.  
  2461.                if ( rc )
  2462.                {
  2463.                   fProgramStarted = FALSE;
  2464.                   WPSTutorialMethodDebug("DisplayMethodInfo",
  2465.                                          "Pipe could not be connected");
  2466.                }
  2467.             }
  2468.          }
  2469.       }
  2470.    }
  2471.  
  2472.    /*
  2473.    **  If the thread was created successfully, or if we didn't have to create
  2474.    **  the thread this time, we'll go ahead and pass the "method ID" to the
  2475.    **  SHOWDESC.EXE program.
  2476.    */
  2477.    if ( !rc )
  2478.    {
  2479.       rc = DosWrite(hNPipe, &ulMethodID, sizeof(ulMethodID), &ulBytesXferred);
  2480.  
  2481.       if ( rc )
  2482.       {
  2483.          WPSTutorialMethodDebug("DisplayMethodInfo", "DosWrite failed");
  2484.       }
  2485.       else
  2486.       {
  2487.          if ( !ulBytesXferred )
  2488.          {
  2489.             WPSTutorialMethodDebug("DisplayMethodInfo",
  2490.                                    "Method ID was not written on pipe");
  2491.          }
  2492.       }
  2493.    }
  2494.  
  2495.    return;
  2496. }
  2497.  
  2498. /*
  2499.  *
  2500.  *  NAME: WPSTutorWndProc
  2501.  *
  2502.  *  DESCRIPTION:
  2503.  *
  2504.  *    This function is the window procedure that processes messages for the
  2505.  *    default open view for an object.
  2506.  *
  2507.  *  RETURN:
  2508.  *
  2509.  *    MRESULT - Based on the message being processed.
  2510.  *
  2511.  */
  2512.  
  2513. MRESULT EXPENTRY WPSTutorWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
  2514. {
  2515.    PWINDOWDATA pWindowData;      /* Window Words instance data               */
  2516.    HWND        hwndFrame;        /* Parent window handle                     */
  2517.  
  2518.    /*
  2519.    **  Get the handle of the parent window.
  2520.    */
  2521.    hwndFrame = WinQueryWindow(hwnd, QW_PARENT);
  2522.  
  2523.    /*
  2524.    **  Process the message that caused the window procedure to be invoked.
  2525.    */
  2526.    switch( msg )
  2527.    {
  2528.       /*
  2529.       **  Create the window for the default open view.
  2530.       */
  2531.       case WM_CREATE:
  2532.  
  2533.         /*
  2534.         **  Get the "Window Words" instance data.
  2535.         */
  2536.         pWindowData = (PWINDOWDATA) mp1;
  2537.  
  2538.         if (pWindowData == NULL)
  2539.         {
  2540.            DebugBox("WPSTutorWndProc:WM_CREATE", "Couldn't get window words");
  2541.            return FALSE;
  2542.         }
  2543.  
  2544.         /*
  2545.         **  Initialize the instance data (class view/usage details and
  2546.         **  window specific data) for this instance.
  2547.         */
  2548.         pWindowData->UseItem.type    = USAGE_OPENVIEW;
  2549.         pWindowData->ViewItem.view   = OPEN_TUTORIAL;
  2550.         pWindowData->ViewItem.handle = hwndFrame;
  2551.  
  2552.         /*
  2553.         **  Set a pointer value into the memory of the reserved window words
  2554.         **  to hold the instance view information.
  2555.         */
  2556.         WinSetWindowPtr(hwnd, QWL_USER, pWindowData);
  2557.  
  2558.         /*
  2559.         **  Add a view to the object's in-use list so the wpSwitchTo works.
  2560.         **  This API tells the shell to store the view in the internal
  2561.         **  linked list for the object to enable wpSwitchTo and other
  2562.         **  methods to find the view.
  2563.         */
  2564.         _wpAddToObjUseList(pWindowData->somSelf, &pWindowData->UseItem);
  2565.  
  2566.         /*
  2567.         **  Register the new open view.
  2568.         */
  2569.         _wpRegisterView(pWindowData->somSelf, hwndFrame,
  2570.                         _wpQueryTitle(pWindowData->somSelf));
  2571.  
  2572.         /*
  2573.         **  Make this window the window in focus.
  2574.         */
  2575.         WinSetFocus(HWND_DESKTOP, hwndFrame);
  2576.  
  2577.         break;
  2578.  
  2579.       /*
  2580.       **  Process a control.
  2581.       */
  2582.       case WM_COMMAND:
  2583.  
  2584.         /*
  2585.         **  There are no control commands to process.
  2586.         */
  2587.         break;
  2588.  
  2589.       /*
  2590.       **  Repaint the window.
  2591.       */
  2592.       case WM_PAINT:
  2593.       {
  2594.          HPS    hps;       /* Presentation space handle                      */
  2595.  
  2596.          hps = WinBeginPaint(hwnd, (HPS)NULLHANDLE, NULL);
  2597.          GpiErase(hps);
  2598.          WinEndPaint(hps);
  2599.  
  2600.          break;
  2601.       }
  2602.  
  2603.       /*
  2604.       **  User closed the window.
  2605.       */
  2606.       case WM_CLOSE:
  2607.       {
  2608.          /*
  2609.          **  Get the instance data.
  2610.          */
  2611.          pWindowData = (PWINDOWDATA) WinQueryWindowPtr(hwnd, QWL_USER);
  2612.  
  2613.          if (pWindowData == NULL)
  2614.          {
  2615.             DebugBox("WPSTutorWndProc:WM_CLOSE", "Couldn't get window words");
  2616.             return FALSE;
  2617.          }
  2618.  
  2619.          /*
  2620.          **  Save the current size and position of the window.
  2621.          */
  2622.          WinStoreWindowPos(szTutorialWindowClass,
  2623.                            _wpQueryTitle(pWindowData->somSelf),
  2624.                            hwndFrame);
  2625.  
  2626.          /*
  2627.          **  Remove the item type from the object's in-use list.
  2628.          */
  2629.          _wpDeleteFromObjUseList(pWindowData->somSelf,
  2630.                                  &pWindowData->UseItem);
  2631.  
  2632.          /*
  2633.          **  Deallocate storage for the instance specific data.
  2634.          */
  2635.          _wpFreeMem(pWindowData->somSelf, (PBYTE)pWindowData);
  2636.  
  2637.          /*
  2638.          **  Post a message to ourselves to terminate the application.
  2639.          */
  2640.          WinPostMsg(hwnd, WM_QUIT, 0, 0);
  2641.  
  2642.          /*
  2643.          **  Destroy the parent window
  2644.          */
  2645.          WinDestroyWindow(hwndFrame);
  2646.          break;
  2647.       }
  2648.  
  2649.       default:
  2650.          /*
  2651.          **  Allow PM to handle all other messages.
  2652.          */
  2653.          return WinDefWindowProc( hwnd, msg, mp1, mp2 );
  2654.    }
  2655.  
  2656.    return FALSE;
  2657.  
  2658. }
  2659.  
  2660. /*
  2661.  *
  2662.  *  NAME: DisplayMethodThread
  2663.  *
  2664.  *  DESCRIPTION:
  2665.  *
  2666.  *    This function starts the 'Show Method Description' program and waits for
  2667.  *    that program to be closed.  (The program can be closed by the user or by
  2668.  *    processing of the 'wpFree' method.)
  2669.  *
  2670.  *  RETURN:
  2671.  *
  2672.  *     0L - Always
  2673.  */
  2674.  
  2675. ULONG DisplayMethodThread(VOID)
  2676. {
  2677.    APIRET       rc = 0;             /* Return code for DosXXX API            */
  2678.    CHAR         szLoadError[100];   /* Buffer for the name of the object     */
  2679.                                     /*   that contributes to DosExecPgm      */
  2680.                                     /*   failure                             */
  2681.    RESULTCODES  ReturnCodes;        /* Termination and result codes for      */
  2682.                                     /*   SHOWDESC.EXE process                */
  2683.    PID          RetProcessID;       /* ID for the process that ends          */
  2684.                                     /*   SHOWDESC.EXE                        */
  2685.  
  2686.    /*
  2687.    **  Start the 'Show Method Description' program.
  2688.    */
  2689.    rc = DosExecPgm(szLoadError,
  2690.                    sizeof(szLoadError),
  2691.                    EXEC_ASYNCRESULT,
  2692.                    NULL,
  2693.                    NULL,
  2694.                    &ReturnCodes,
  2695.                    DISPLAY_PROGRAM_NAME);
  2696.  
  2697.    if ( rc )
  2698.    {
  2699.       WPSTutorialMethodDebug("DisplayMethodThread", "DosExecPgm failed");
  2700.    }
  2701.    else
  2702.    {
  2703.       /*
  2704.       **  The program was started successfully, so we can set our global flag
  2705.       **  to indicate that.
  2706.       */
  2707.       fProgramStarted = TRUE;
  2708.  
  2709.       /*
  2710.       **  Store the process ID for 'Show Method Description' so that it can
  2711.       **  be killed by 'wpFree' if needed.
  2712.       */
  2713.       ShowMethDescPID = ReturnCodes.codeTerminate;
  2714.  
  2715.       /*
  2716.       **  Wait for 'Show Method Description' to be killed.
  2717.       */
  2718.       rc = DosWaitChild(DCWA_PROCESS, DCWW_WAIT, &ReturnCodes, &RetProcessID,
  2719.                         ShowMethDescPID);
  2720.    }
  2721.  
  2722.    /*
  2723.    **  Close the pipe used to communicate with 'Show Method Description'.
  2724.    */
  2725.    DosDisConnectNPipe(hNPipe);
  2726.    DosClose(hNPipe);
  2727.  
  2728.    /*
  2729.    **  Reset the global flag to indicate that the SHOWDESC.EXE program is
  2730.    **  not up.
  2731.    */
  2732.    fProgramStarted = FALSE;
  2733.  
  2734.    /*
  2735.    **  Exit the thread.
  2736.    */
  2737.    DosExit(EXIT_THREAD, 0L);
  2738.    return 0L;
  2739. }
  2740.