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