home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vptool.zip / vpdial.c < prev    next >
Text File  |  1994-01-13  |  22KB  |  614 lines

  1.  
  2. /* Copyright HockWare, Inc. 1994 */
  3.  
  4. #define  INCL_WIN                   /* required to use Win APIs.           */
  5. #define  INCL_DOS
  6. #define  INCL_PM                    /* required to use PM APIs.            */
  7. #define  INCL_WINHELP               /* required to use IPF.                */
  8. #define  INCL_OS2MM                 /* required for MCI and MMIO headers   */
  9. #define  INCL_MMIOOS2               /* required for MMVIDEOHEADER          */
  10. #define  INCL_MMIO_CODEC            /* required for circular, secondary    */
  11. #define  INCL_SW                    /* required for circular, secondary    */
  12.  
  13. #include <os2.h>
  14. #include <os2me.h>
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18.  
  19. #include <sw.h>
  20.  
  21. #define VPDial_Class_Source
  22. #include "vpDial.ih"
  23.  
  24. /* function prototype for the VpDial REXX extension */
  25. ULONG   VpDial(PSZ Name, LONG Argc, RXSTRING Argv[], PSZ QueueName,
  26.                PRXSTRING Retstr);
  27.  
  28. VPLOGICITEM Logic[] = {
  29.           {
  30.           130,                                        /* help panel ID    */
  31.           "Set range",                                /* descriptive name */
  32.           "CALL VpDial window, %s, 'SETRANGE', 0, 10",/* function model   */
  33.           0,
  34.           0
  35.           },
  36.           {
  37.           131,
  38.           "Get range",
  39.           "range=VpDial(window, %s, 'GETRANGE')\r\nPARSE VAR range lo hi",
  40.           0,
  41.           0
  42.           },
  43.           {
  44.           132,
  45.           "Get value",
  46.           "value=VpDial(window, %s, 'GETVALUE')",
  47.           0,
  48.           0
  49.           },
  50.           {
  51.           133,
  52.           "Set value",
  53.           "CALL VpDial window, %s, 'SETVALUE', value",
  54.           0,
  55.           0
  56.           },
  57.           {
  58.           134,
  59.           "Set increment",
  60.           "/* 1st is button increment, 2nd is tick increment */\r\n"
  61.           "CALL VpDial window, %s, 'SETINC', 1, 5",
  62.           0,
  63.           0
  64.           },
  65.           {
  66.           135,
  67.           "Get increment",
  68.           "inc=VpDial(window, %s, 'GETINC')\r\nPARSE VAR inc increment tick",
  69.           0,
  70.           0
  71.           },
  72.           {
  73.           136,
  74.           "Get radius",
  75.           "value=VpDial(window, %s, 'GETRAD')",
  76.           0,
  77.           0
  78.           },
  79.           { /* this record marks the end of the list */
  80.           0,
  81.           "",
  82.           "",
  83.           0,
  84.           0
  85.           }
  86.        };
  87. #define INCL_CIRCULARSLIDER
  88. #include <sw.h>
  89.  
  90. /* dialog procedure for the Styles page dialog procedure */
  91. MRESULT EXPENTRY StyleDlgProc( HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2 )
  92. {
  93.    SOMAny * somSelf = (SOMAny *)WinQueryWindowULong(hwndDlg, QWL_USER);
  94.    ULONG ulStyle;
  95.    ULONG ulStyleOld;
  96.    BOOL bRecreate;
  97.  
  98.    switch (msg) {
  99.    case WM_INITDLG:
  100.       somSelf=(SOMAny *)PVOIDFROMMP(mp2);
  101.       WinSetWindowULong(hwndDlg, QWL_USER, (ULONG)somSelf);
  102.       _SetInitializedFlag(somSelf,FALSE);
  103.       ulStyle = WinQueryWindowULong(_GetHwnd(somSelf), QWL_STYLE);
  104.  
  105.       /* save for undoing */
  106.       _SetStyle(somSelf, ulStyle);
  107.  
  108.       WinSendMsg(hwndDlg,WM_VPRSETVALUES,0,0);
  109.  
  110.       break;
  111.    case WM_VPRSETVALUES:
  112.       ulStyle=_GetStyle(somSelf);
  113.       if (ulStyle & WS_VISIBLE) {
  114.          WinCheckButton(hwndDlg, ID_VISIBLE, 1);
  115.       } else {
  116.          WinCheckButton(hwndDlg, ID_VISIBLE, 0);
  117.       } /* endif */
  118.       if (ulStyle & WS_DISABLED) {
  119.          WinCheckButton(hwndDlg, ID_DISABLED, 1);
  120.       } else {
  121.          WinCheckButton(hwndDlg, ID_DISABLED, 0);
  122.       } /* endif */
  123.       if (ulStyle & WS_GROUP) {
  124.          WinCheckButton(hwndDlg, ID_GROUP, 1);
  125.       } else {
  126.          WinCheckButton(hwndDlg, ID_GROUP, 0);
  127.       } /* endif */
  128.       if (ulStyle & WS_TABSTOP) {
  129.          WinCheckButton(hwndDlg, ID_TABSTOP, 1);
  130.       } else {
  131.          WinCheckButton(hwndDlg, ID_TABSTOP, 0);
  132.       } /* endif */
  133.  
  134.       if (ulStyle & CSS_NOBUTTON) {
  135.          WinCheckButton(hwndDlg, ID_NOBUTTON, 1);
  136.       } else {
  137.          WinCheckButton(hwndDlg, ID_NOBUTTON, 0);
  138.       } /* endif */
  139.       if (ulStyle & CSS_NOTEXT) {
  140.          WinCheckButton(hwndDlg, ID_NOTEXT, 1);
  141.       } else {
  142.          WinCheckButton(hwndDlg, ID_NOTEXT, 0);
  143.       } /* endif */
  144.       if (ulStyle & CSS_NONUMBER) {
  145.          WinCheckButton(hwndDlg, ID_NONUMBER, 1);
  146.       } else {
  147.          WinCheckButton(hwndDlg, ID_NONUMBER, 0);
  148.       } /* endif */
  149.       if (ulStyle & CSS_POINTSELECT) {
  150.          WinCheckButton(hwndDlg, ID_POINTSELECT, 1);
  151.       } else {
  152.          WinCheckButton(hwndDlg, ID_POINTSELECT, 0);
  153.       } /* endif */
  154.       if (ulStyle & CSS_360) {
  155.          WinCheckButton(hwndDlg, ID_360, 1);
  156.       } else {
  157.          WinCheckButton(hwndDlg, ID_360, 0);
  158.       } /* endif */
  159.       if (ulStyle & CSS_NOBUTTON) {
  160.          WinCheckButton(hwndDlg, ID_MIDPOINT, 1);
  161.       } else {
  162.          WinCheckButton(hwndDlg, ID_MIDPOINT, 0);
  163.       } /* endif */
  164.       if (ulStyle & CSS_PROPORTIONALTICKS) {
  165.          WinCheckButton(hwndDlg, ID_PROPORTIONALTICKS, 1);
  166.       } else {
  167.          WinCheckButton(hwndDlg, ID_PROPORTIONALTICKS, 0);
  168.       } /* endif */
  169.  
  170.       _SetInitializedFlag(somSelf,TRUE);
  171.       break;
  172.    case WM_CONTROL:
  173.       if (_GetInitializedFlag(somSelf)) {
  174.           ulStyleOld = WinQueryWindowULong(_GetHwnd(somSelf),QWL_STYLE);
  175.           ulStyle = ulStyleOld;
  176.           bRecreate=FALSE;
  177.  
  178.           switch ( SHORT1FROMMP( mp1 ) ) {
  179.           case ID_VISIBLE:
  180.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  181.                 WinShowWindow(_GetHwnd(somSelf),
  182.                     WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 )));
  183.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  184.                    ulStyle |= WS_VISIBLE;
  185.                 } else {
  186.                    ulStyle &= ~WS_VISIBLE;
  187.                 } /* endif */
  188.              } /* endif */
  189.              break;
  190.           case ID_TABSTOP:
  191.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  192.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  193.                    ulStyle |= WS_TABSTOP;
  194.                 } else {
  195.                    ulStyle &= ~WS_TABSTOP;
  196.                 } /* endif */
  197.              } /* endif */
  198.              break;
  199.           case ID_DISABLED:
  200.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  201.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  202.                    ulStyle |= WS_DISABLED;
  203.                 } else {
  204.                    ulStyle &= ~WS_DISABLED;
  205.                 } /* endif */
  206.              } /* endif */
  207.              break;
  208.           case ID_GROUP:
  209.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  210.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  211.                    ulStyle |= WS_GROUP;
  212.                 } else {
  213.                    ulStyle &= ~WS_GROUP;
  214.                 } /* endif */
  215.              } /* endif */
  216.              break;
  217.           case ID_NOBUTTON:
  218.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  219.                 bRecreate=TRUE;
  220.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  221.                    ulStyle |= CSS_NOBUTTON;
  222.                 } else {
  223.                    ulStyle &= ~CSS_NOBUTTON;
  224.                 } /* endif */
  225.              } /* endif */
  226.              break;
  227.           case ID_NOTEXT:
  228.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  229.                 bRecreate=TRUE;
  230.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  231.                    ulStyle |= CSS_NOTEXT;
  232.                 } else {
  233.                    ulStyle &= ~CSS_NOTEXT;
  234.                 } /* endif */
  235.              } /* endif */
  236.              break;
  237.           case ID_NONUMBER:
  238.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  239.                 bRecreate=TRUE;
  240.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  241.                    ulStyle |= CSS_NONUMBER;
  242.                 } else {
  243.                    ulStyle &= ~CSS_NONUMBER;
  244.                 } /* endif */
  245.              } /* endif */
  246.              break;
  247.           case ID_POINTSELECT:
  248.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  249.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  250.                    ulStyle |= CSS_POINTSELECT;
  251.                 } else {
  252.                    ulStyle &= ~CSS_POINTSELECT;
  253.                 } /* endif */
  254.              } /* endif */
  255.              break;
  256.           case ID_360:
  257.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  258.                 bRecreate=TRUE;
  259.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  260.                    ulStyle |= CSS_360;
  261.                 } else {
  262.                    ulStyle &= ~CSS_360;
  263.                 } /* endif */
  264.              } /* endif */
  265.              break;
  266.           case ID_MIDPOINT:
  267.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  268.                 bRecreate=TRUE;
  269.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  270.                    ulStyle |= CSS_MIDPOINT;
  271.                 } else {
  272.                    ulStyle &= ~CSS_MIDPOINT;
  273.                 } /* endif */
  274.              } /* endif */
  275.              break;
  276.           case ID_PROPORTIONALTICKS:
  277.              if (SHORT2FROMMP(mp1) == BN_CLICKED) {
  278.                 bRecreate=TRUE;
  279.                 if (WinQueryButtonCheckstate(hwndDlg,SHORT1FROMMP( mp1 ))) {
  280.                    ulStyle |= CSS_PROPORTIONALTICKS;
  281.                 } else {
  282.                    ulStyle &= ~CSS_PROPORTIONALTICKS;
  283.                 } /* endif */
  284.              } /* endif */
  285.              break;
  286.           } /* endswitch */
  287.           if (ulStyle!=ulStyleOld) {
  288.              _IndicateChanged(somSelf);
  289.              WinSetWindowULong(_GetHwnd(somSelf),QWL_STYLE,ulStyle);
  290.              if (bRecreate) {
  291.                _RecreateObject(somSelf);
  292.              } else {
  293.                _RedrawObject(somSelf);
  294.              } /* endif */
  295.           } /* endif */
  296.       } /* endif */
  297.  
  298.       break;
  299.    case WM_COMMAND:
  300.       switch (SHORT1FROMMP(mp1)) {
  301.       case ID_RESET:
  302.          /* flag the object as changed so VisPro/REXX will save it */
  303.          _IndicateChanged(somSelf);
  304.          WinSendMsg(hwndDlg,WM_VPRSETVALUES,0,0);
  305.          ulStyle=_GetStyle(somSelf);
  306.          WinShowWindow(_GetHwnd(somSelf),
  307.                  ((ulStyle & WS_VISIBLE)!=0));
  308.          WinSetWindowULong(_GetHwnd(somSelf),QWL_STYLE,ulStyle);
  309.          _RecreateObject(somSelf);
  310.  
  311.          break;
  312.       } /* endswitch */
  313.  
  314.       break;
  315.    case WM_HELP:
  316.       WinPostMsg(_QueryHelpInstance(_somGetClass(somSelf)),
  317.                  HM_DISPLAY_HELP,
  318.                  MPFROMLONG(110),
  319.                  HM_RESOURCEID);
  320.       break;
  321.    default :
  322.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  323.    } /* endswitch */
  324.    return FALSE;
  325. }
  326.  
  327. /* the VPDial REXX Extension */
  328.  
  329. ULONG VpDial(PSZ Name, LONG Argc, RXSTRING Argv[], PSZ QueueName,
  330.              PRXSTRING Retstr)
  331. {
  332.    ULONG ulID;
  333.    HWND hwnd;
  334.    HWND hwndControl;
  335.    LONG lTemp1, lTemp2;
  336.  
  337.    Retstr->strptr[0]=0;
  338.    Retstr->strlength = 0;
  339.    //check for valid args
  340.  
  341.    if (Argc<3)
  342.       return 40;
  343.  
  344.    hwnd = (HWND) atol(Argv[0].strptr);
  345.    if (!WinIsWindow(0,hwnd))
  346.       return 40;
  347.  
  348.    ulID = atol(Argv[1].strptr);
  349.  
  350.    hwndControl = WinWindowFromID(hwnd, ulID);
  351.  
  352.    if (!hwndControl)
  353.       return 40;
  354.    if (!WinIsWindow(0,hwndControl))
  355.       return 40;
  356.  
  357.    if (!strcmp(Argv[2].strptr, "SETRANGE")) {
  358.       if (Argc != 5)
  359.          return 40;
  360.       lTemp1=atol(Argv[3].strptr);
  361.       lTemp2=atol(Argv[4].strptr);
  362.       WinSendMsg(hwndControl, CSM_SETRANGE, MPFROMLONG(lTemp1),
  363.                  MPFROMLONG(lTemp2));
  364.  
  365.    } else if (!strcmp(Argv[2].strptr, "GETRANGE")) {
  366.       WinSendMsg(hwndControl, CSM_QUERYRANGE, MPFROMP(&lTemp1),
  367.                  MPFROMP(&lTemp2));
  368.       sprintf(Retstr->strptr,"%d %d",lTemp1, lTemp2);
  369.  
  370.    } else if (!strcmp(Argv[2].strptr, "SETVALUE")) {
  371.       if (Argc != 4)
  372.          return 40;
  373.       lTemp1=atol(Argv[3].strptr);
  374.       WinSendMsg(hwndControl, CSM_SETVALUE, MPFROMLONG(lTemp1), 0);
  375.  
  376.    } else if (!strcmp(Argv[2].strptr, "GETVALUE")) {
  377.       WinSendMsg(hwndControl, CSM_QUERYVALUE, MPFROMP(&lTemp1), 0);
  378.       sprintf(Retstr->strptr,"%d",lTemp1);
  379.  
  380.    } else if (!strcmp(Argv[2].strptr, "GETRAD")) {
  381.       WinSendMsg(hwndControl, CSM_QUERYRADIUS, MPFROMP(&lTemp1), 0);
  382.       sprintf(Retstr->strptr,"%d",lTemp1);
  383.  
  384.    } else if (!strcmp(Argv[2].strptr, "SETINC")) {
  385.       if (Argc != 5)
  386.          return 40;
  387.       lTemp1=atol(Argv[3].strptr);
  388.       lTemp2=atol(Argv[4].strptr);
  389.       WinSendMsg(hwndControl, CSM_SETINCREMENT, MPFROMLONG(lTemp1),
  390.                  MPFROMLONG(lTemp2));
  391.  
  392.    } else if (!strcmp(Argv[2].strptr, "GETINC")) {
  393.       WinSendMsg(hwndControl, CSM_QUERYINCREMENT, MPFROMP(&lTemp1),
  394.                  MPFROMP(&lTemp2));
  395.       sprintf(Retstr->strptr,"%d %d",lTemp1, lTemp2);
  396.  
  397.  
  398.    } else {
  399.       return 40;
  400.    } /* endif */
  401.  
  402.    Retstr->strlength = strlen(Retstr->strptr);
  403.    return 0;
  404.  
  405. }
  406.  
  407.  
  408. /*
  409.  *
  410.  *   METHOD:   GetStyle
  411.  *   PURPOSE:  Get the style word used for reseting
  412.  *   INVOKED:  From style dialog in editor session
  413.  *
  414.  */
  415.  
  416. SOM_Scope ULONG   SOMLINK vpdia_GetStyle(VPDial *somSelf)
  417. {
  418.     VPDialData *somThis = VPDialGetData(somSelf);
  419.     VPDialMethodDebug("VPDial","vpdia_GetStyle");
  420.  
  421.     return (ULONG) _ulStyle;
  422. }
  423.  
  424. /*
  425.  *
  426.  *   METHOD:   SetStyle
  427.  *   PURPOSE:  Set the style word used for reseting
  428.  *   INVOKED:  From style dialog in editor session
  429.  *
  430.  */
  431.  
  432. SOM_Scope VOID   SOMLINK vpdia_SetStyle(VPDial *somSelf,
  433.                 ULONG ulStyle)
  434. {
  435.     VPDialData *somThis = VPDialGetData(somSelf);
  436.     VPDialMethodDebug("VPDial","vpdia_SetStyle");
  437.  
  438.     _ulStyle=ulStyle;
  439.  
  440. }
  441.  
  442. /*
  443.  *
  444.  *   METHOD:   GetInitializedFlag
  445.  *   PURPOSE:  Get the initialized word
  446.  *   INVOKED:  From style dialog in editor session
  447.  *
  448.  */
  449.  
  450. SOM_Scope BOOL   SOMLINK vpdia_GetInitializedFlag(VPDial *somSelf)
  451. {
  452.     VPDialData *somThis = VPDialGetData(somSelf);
  453.     VPDialMethodDebug("VPDial","vpdia_GetInitializedFlag");
  454.  
  455.     return (BOOL) _bInitialized;
  456. }
  457.  
  458. /*
  459.  *
  460.  *   METHOD:   SetInitializedFlag
  461.  *   PURPOSE:  Set the initialized flag
  462.  *   INVOKED:  From style dialog in editor session
  463.  *
  464.  */
  465.  
  466. SOM_Scope VOID   SOMLINK vpdia_SetInitializedFlag(VPDial *somSelf,
  467.                 BOOL bInitialized)
  468. {
  469.     VPDialData *somThis = VPDialGetData(somSelf);
  470.     VPDialMethodDebug("VPDial","vpdia_SetInitializedFlag");
  471.  
  472.     _bInitialized=bInitialized;
  473.  
  474. }
  475. #undef SOM_CurrentClass
  476. #define SOM_CurrentClass SOMMeta
  477. SOM_Scope VOID   SOMLINK vpdiac_QueryClassInfo(M_VPDial *somSelf,
  478.                 PVPCLASSINFO pVpClassInfo)
  479. {
  480.     M_VPDialData *somThis = M_VPDialGetData(somSelf);
  481.     M_VPDialMethodDebug("M_VPDial","vpdiac_QueryClassInfo");
  482.  
  483.     if (pVpClassInfo) {
  484.        pVpClassInfo->cbSize=sizeof(VPCLASSINFO);
  485.        pVpClassInfo->pszDescName       = "Circular Slider";
  486.        pVpClassInfo->pszAbbrevName     = "CSLD";
  487.        pVpClassInfo->bHasText          = TRUE;
  488.        pVpClassInfo->pszDefaultText    = 0;
  489.        pVpClassInfo->bHasCtrlData      = FALSE;
  490.        pVpClassInfo->pszWindowClass    = WC_CIRCULARSLIDER;
  491.        pVpClassInfo->lDefaultWidth     = 66;
  492.        pVpClassInfo->lDefaultHeight    = 66;
  493.        pVpClassInfo->ulDefaultStyle    =
  494.                   WS_GROUP | WS_VISIBLE | WS_NOTEXT | WS_TABSTOP |
  495.                   CSS_MIDPOINT | CSS_PROPORTIONALTICKS;
  496.        pVpClassInfo->pDefaultCtrlData  = 0;
  497.        pVpClassInfo->hModResource      = _hModResource;
  498.        pVpClassInfo->lIconResID        = ID_POINTER;
  499.        pVpClassInfo->lStyleDlgID       = ID_DIALDLG;
  500.        pVpClassInfo->pfnwpStyleDlgProc = StyleDlgProc;
  501.        pVpClassInfo->lToolHelpID       = 100;
  502.        pVpClassInfo->lStylesPageHelpID = 110;
  503.        pVpClassInfo->hwndHelpInstance  = 0;
  504.        pVpClassInfo->lNumEvents        = 3;
  505.        pVpClassInfo->Events[0].pszDescName="Entered";
  506.        pVpClassInfo->Events[0].pszAbbrevName="ENT";
  507.        pVpClassInfo->Events[0].pszModel=0;
  508.        pVpClassInfo->Events[0].lIconResID=ID_ENTERPTR;
  509.        pVpClassInfo->Events[0].lHelpID=120;
  510.        pVpClassInfo->usTranslate[0]=CSN_SETFOCUS;
  511.        pVpClassInfo->Events[1].pszDescName="Changed";
  512.        pVpClassInfo->Events[1].pszAbbrevName="CHG";
  513.        pVpClassInfo->Events[1].pszModel=0;
  514.        pVpClassInfo->Events[1].lIconResID=ID_CHANGEDPTR;
  515.        pVpClassInfo->Events[1].lHelpID=121;
  516.        pVpClassInfo->usTranslate[1]=CSN_CHANGED;
  517.        pVpClassInfo->Events[2].pszDescName="Tracking";
  518.        pVpClassInfo->Events[2].pszAbbrevName="TRK";
  519.        pVpClassInfo->Events[2].pszModel=0;
  520.        pVpClassInfo->Events[2].lIconResID=ID_TRACKINGPTR;
  521.        pVpClassInfo->Events[2].lHelpID=122;
  522.        pVpClassInfo->usTranslate[2]=CSN_TRACKING;
  523.        pVpClassInfo->Logic             = Logic;
  524.     } /* endif */
  525. }
  526.  
  527. SOM_Scope void   SOMLINK vpdiac_somInitClass(M_VPDial *somSelf,
  528.                 IN zString className,
  529.                 IN SOMAny *parentClass,
  530.                 IN integer4 instanceSize,
  531.                 IN int maxStaticMethods,
  532.                 IN integer4 majorVersion,
  533.                 IN integer4 minorVersion)
  534. {
  535.     M_VPDialData *somThis = M_VPDialGetData(somSelf);
  536.     CHAR ErrorBuffer[100];
  537.     M_VPDialMethodDebug("M_VPDial","vpdiac_somInitClass");
  538.  
  539.     DosLoadModule((PSZ) ErrorBuffer, sizeof(ErrorBuffer), "VPDIAL",
  540.                   &_hModResource);
  541.     WinRegisterCircularSlider();
  542.     RexxRegisterFunctionDll("VpDial","VPDIAL","VpDial");
  543.  
  544.     parent_somInitClass(somSelf,className,parentClass,instanceSize,
  545.                         maxStaticMethods,majorVersion,minorVersion);
  546. }
  547.  
  548. SOM_Scope HWND   SOMLINK vpdiac_InitHelpInstance(M_VPDial *somSelf)
  549. {
  550.     M_VPDialData *somThis = M_VPDialGetData(somSelf);
  551.     HELPINIT hmiHelpData;       /* Help initialization structure     */
  552.     HWND hwndHelpInstance;
  553.     CHAR pszHelp[CCHMAXPATH];
  554.     PSZ pszTemp;
  555.  
  556.     M_VPDialMethodDebug("M_VPDial","vpdiac_InitHelpInstance");
  557.  
  558.     if (DosScanEnv("VISPRORX",&pszTemp)) {
  559.        strcpy(pszHelp,"C:\\VISPRORX");
  560.     } else {
  561.        strcpy(pszHelp,pszTemp);
  562.     } /* endif */
  563.     strcat(pszHelp,"\\VPDIAL.HLP");
  564.  
  565.     /**********************************************************************/
  566.     /* IPF Initialization Structure                                       */
  567.     /**********************************************************************/
  568.     /* size of initialization structure                                   */
  569.     /**********************************************************************/
  570.     hmiHelpData.cb = sizeof(HELPINIT);
  571.     /**********************************************************************/
  572.     /* store HM return code from init.                                    */
  573.     /**********************************************************************/
  574.     hmiHelpData.ulReturnCode = (ULONG)NULL;
  575.     /**********************************************************************/
  576.     /* no tutorial program                                                */
  577.     /**********************************************************************/
  578.     hmiHelpData.pszTutorialName = NULL;
  579.     /**********************************************************************/
  580.     /* indicates help table is defined in the RC file.                    */
  581.     /**********************************************************************/
  582.     hmiHelpData.phtHelpTable = 0;
  583.     /**********************************************************************/
  584.     /* action bar is not tailored                                         */
  585.     /**********************************************************************/
  586.     hmiHelpData.hmodAccelActionBarModule = 0;
  587.     hmiHelpData.idAccelTable = 0;
  588.     hmiHelpData.idActionBar = 0;
  589.     /**********************************************************************/
  590.     /* help window title                                                  */
  591.     /**********************************************************************/
  592.     hmiHelpData.pszHelpWindowTitle = "VisPro/REXX Circular Slider Help Window";
  593.     /**********************************************************************/
  594.     /* help table in not in a DLL                                         */
  595.     /**********************************************************************/
  596.     hmiHelpData.hmodHelpTableModule = 0;
  597.     /**********************************************************************/
  598.     /* help panels ID is not displayed                                    */
  599.     /**********************************************************************/
  600.     hmiHelpData.fShowPanelId = 0;
  601.     /**********************************************************************/
  602.     /* library with help panels                                           */
  603.     /**********************************************************************/
  604.     hmiHelpData.pszHelpLibraryName = pszHelp;
  605.     /**********************************************************************/
  606.     /* Create Instance of IPF pass Anchor Block handle and address of IPF */
  607.     /* initialization structure, and check that creation was successful.  */
  608.     /**********************************************************************/
  609.     hwndHelpInstance = WinCreateHelpInstance(0, &hmiHelpData);
  610.  
  611.  
  612.     return (hwndHelpInstance);
  613. }
  614.