home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / power.zip / TEST.C < prev    next >
C/C++ Source or Header  |  1994-11-09  |  26KB  |  522 lines

  1. /*______________________________________________________________________
  2. |                PowerThread  (c) 1994 Greg Ratajik                     |
  3. |-----------------------------------------------------------------------|
  4. | Description:  This module allows testing of the PowerThread function  |
  5. |               calls.  See POWER.C or POWER.DOC for more information.  |
  6. |                                                                       |
  7. |   *****************************************************************   |
  8. |   *DISCLAIMER OF WARRANTIES.  The following  code is              *   |
  9. |   * sample code created by Greg Ratajik.  The code is provided    *   |
  10. |   *"AS IS", without warranty of any kind.  Greg Ratatjik shall not*   |
  11. |   *be liable for any damages arising out of your use of the sample*   |
  12. |   *code.                                                          *   |
  13. |   *****************************************************************   |
  14. |_____________________________________________________________________*/
  15. #define INCL_PM             /*  PM Support                           */
  16. #define INCL_DOSPROCESS     /*  Process and thread support           */
  17. #define INCL_DOSMODULEMGR   /*  Support DosLoad DosGetProgAddr       */
  18.  
  19. /*______________________________________________________________________
  20. |                                                                       |
  21. |                         System Includes                               |
  22. |_____________________________________________________________________*/
  23. #define _MT
  24.  
  25. #include <os2.h>            /* Base OS/2 Include                     */
  26. #include <string.h>         /* Standard C functions                  */
  27. #include <stdlib.h>         /* malloc and free                       */
  28. #include <process.h>        /* _beginthread support                  */
  29.  
  30. /*______________________________________________________________________
  31. |                                                                       |
  32. |             Application Specific Includes & Defines                   |
  33. |_____________________________________________________________________*/
  34. #include "test.rch"  /* RC info for the DLG                    */
  35. #include "power.h"   /* Prototypes for PowerCalls              */
  36.  
  37. #define DYNOHELP_DYNAMIC_LINK
  38. #include "DynoHelp.h"
  39.  
  40. /*______________________________________________________________________
  41. |                                                                       |
  42. |  Gobal Local Variables                        |
  43. |_____________________________________________________________________*/
  44. HAB   hAB;
  45.  
  46. /*____________________________________________________________________
  47. |                                      |
  48. |  Function Prototypes.                           |
  49. |____________________________________________________________________*/
  50. MRESULT EXPENTRY AppWndProc(HWND hwndClient,ULONG ulMsg,MPARAM mpParm1, MPARAM mpParm2);
  51.  
  52.  
  53. INT  _System ProcessTest ( USHORT *);
  54.  
  55. HSWITCH AddTask (HWND hWndDlg, CHAR *szSwitchTitle, USHORT usID);
  56. BOOL    LoadDLLS( VOID );
  57.  
  58. /*___________________________________________________________________________
  59. |                                                                            |
  60. |    Function: Main                                 |
  61. |                                                                            |
  62. | Description: Main function                                                 |
  63. |                                         |
  64. |      Return: SHORT                                                         |
  65. |                                                                            |
  66. | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  |
  67. |                 C H A N G E    L O G                 |
  68. | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  |
  69. |                                                                            |
  70. |  PRG.    DATE       DESCRIPTION                                           |
  71. |  ----    ---------- ---------------------------------------------------   |
  72. |  RATAJIK 10-01-1994 Initial Developement                                  |
  73. |___________________________________________________________________________*/
  74. main(int argc, char *argv[])
  75. {
  76. HMQ hMQ;
  77.  
  78.  hAB = WinInitialize(0);                /* Init the process for PM         */
  79.  hMQ = WinCreateMsgQueue(hAB, 0);       /* Create a Message queue          */
  80.  
  81.  
  82.  /*____________________________________
  83.  |                                     |
  84.  | Start the test DLG.                 |
  85.  |                                     |
  86.  |____________________________________*/
  87.  WinDlgBox(HWND_DESKTOP,
  88.            HWND_DESKTOP,
  89.            AppWndProc,
  90.            0,
  91.            DLG_APP_TEST,
  92.            (PVOID)NULL);
  93.  
  94. return(0);
  95. }
  96.  
  97. /*___________________________________________________________________________
  98. |                                                                            |
  99. |    Function: AppWndProc                                                    |
  100. |                                                                            |
  101. | Description: Test window proc to test PowerThreads                         |
  102. |                                         |
  103. |      Return: SHORT                                                         |
  104. |                                                                            |
  105. | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  |
  106. |                 C H A N G E    L O G                 |
  107. | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  |
  108. |                                                                            |
  109. |  PRG.    DATE       DESCRIPTION                                           |
  110. |  ----    ---------- ---------------------------------------------------   |
  111. |  RATAJIK 10-01-1994 Initial Developement                                  |
  112. |___________________________________________________________________________*/
  113. MRESULT EXPENTRY AppWndProc(HWND hWndDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
  114.  
  115. {
  116.    USHORT usTotal;
  117.    CHAR   szTmp[250];
  118.  
  119.    switch (msg)
  120.       {
  121.          case WM_INITDLG:
  122.               /*____________________________________
  123.               |                                     |
  124.               | NOTE: This version of Dynohelp is   |
  125.               | pre-BETA.  I will be releasing a    |
  126.               | toolkit of this, among other things |
  127.               | at a later time.  THING WILL CHANGE |
  128.               | BETWEEN THIS VERSION AND THE NEXT!  |
  129.               | (So use at your own risk...         |
  130.               |____________________________________*/
  131.               /*____________________________________
  132.               |                                     |
  133.               | Try and load the DYNOHELP DLL, and  |
  134.               | resolve the address.  If we can't,  |
  135.               | it's okay, just don't use dynohelp..|
  136.               |____________________________________*/
  137.               if(LoadDLLS())
  138.                  {
  139.                   /*____________________________________
  140.                   |                                     |
  141.                   | Set up the dynamic help for         |
  142.                   | everything.                         |
  143.                   |____________________________________*/
  144.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, PB_THREAD_1     ), HTX_PB_THREAD_1    , TX_HELP, TRUE);
  145.  
  146.                   DynoCreateHelp(hWndDlg, hWndDlg                                   , HTX_DLG_APP_TEST   , TX_HELP, TRUE);
  147.  
  148.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, PB_THREAD_2     ), HTX_PB_THREAD_2    , TX_HELP, TRUE);
  149.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, PB_THREAD_3     ), HTX_PB_THREAD_3    , TX_HELP, TRUE);
  150.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, PB_NO_THREAD    ), HTX_PB_NO_THREAD   , TX_HELP, TRUE);
  151.  
  152.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, EF_NUMBER       ), HTX_EF_NUMBER      , TX_HELP, TRUE);
  153.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_INFO         ), HTX_TX_INFO        , TX_HELP, TRUE);
  154.  
  155.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_APP_NAME     ), HTX_TX_APP_NAME    , TX_HELP, TRUE);
  156.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_COPYRIGHT    ), HTX_TX_COPYRIGHT   , TX_HELP, TRUE);
  157.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_CONTACT_INFO1), HTX_TX_CONTACT_INFO, TX_HELP, TRUE);
  158.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_CONTACT_INFO2), HTX_TX_CONTACT_INFO, TX_HELP, TRUE);
  159.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_CONTACT_INFO3), HTX_TX_CONTACT_INFO, TX_HELP, TRUE);
  160.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, TX_CONTACT_INFO4), HTX_TX_CONTACT_INFO, TX_HELP, TRUE);
  161.  
  162.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, FID_SYSMENU ), HTX_FID_SYSMENU, TX_HELP, TRUE);
  163.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, FID_TITLEBAR), HTX_FID_TITLEBAR, TX_HELP, TRUE);
  164.                   DynoCreateHelp(hWndDlg, WinWindowFromID(hWndDlg, FID_MINMAX  ), HTX_FID_MINMAX, TX_HELP, TRUE);
  165.                  }
  166.  
  167.               AddTask(hWndDlg, "PowerThreads Test", DLG_APP_TEST);
  168.  
  169.               WinSetDlgItemText(hWndDlg, TX_INFO, POWER_INFO);
  170.               WinSetDlgItemText(hWndDlg, EF_NUMBER, "5");
  171.  
  172.               break;
  173.  
  174.          case WM_CLOSE:
  175.               /*____________________________________
  176.               |                                     |
  177.               | Remove help from all of the controls|
  178.               | (Dynohelp is Dynamic, so it won't   |
  179.               | cause a problem if the control is   |
  180.               | still visible after the help has    |
  181.               | been removed.                       |
  182.               |____________________________________*/
  183.               WinSendMsg(hWndDlg, WM_DYNO_DELETE, 0, 0);
  184.               WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_1     ), WM_DYNO_DELETE, 0, 0);
  185.               WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_2     ), WM_DYNO_DELETE, 0, 0);
  186.               WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_3     ), WM_DYNO_DELETE, 0, 0);
  187.               WinSendMsg(WinWindowFromID(hWndDlg, PB_NO_THREAD    ), WM_DYNO_DELETE, 0, 0);
  188.               WinSendMsg(WinWindowFromID(hWndDlg, EF_NUMBER       ), WM_DYNO_DELETE, 0, 0);
  189.               WinSendMsg(WinWindowFromID(hWndDlg, TX_INFO         ), WM_DYNO_DELETE, 0, 0);
  190.               WinSendMsg(WinWindowFromID(hWndDlg, TX_APP_NAME     ), WM_DYNO_DELETE, 0, 0);
  191.               WinSendMsg(WinWindowFromID(hWndDlg, TX_COPYRIGHT    ), WM_DYNO_DELETE, 0, 0);
  192.               WinSendMsg(WinWindowFromID(hWndDlg, TX_CONTACT_INFO1), WM_DYNO_DELETE, 0, 0);
  193.               WinSendMsg(WinWindowFromID(hWndDlg, TX_CONTACT_INFO2), WM_DYNO_DELETE, 0, 0);
  194.               WinSendMsg(WinWindowFromID(hWndDlg, TX_CONTACT_INFO3), WM_DYNO_DELETE, 0, 0);
  195.               WinSendMsg(WinWindowFromID(hWndDlg, TX_CONTACT_INFO4), WM_DYNO_DELETE, 0, 0);
  196.               WinSendMsg(WinWindowFromID(hWndDlg, FID_SYSMENU     ), WM_DYNO_DELETE, 0, 0);
  197.               WinSendMsg(WinWindowFromID(hWndDlg, FID_TITLEBAR    ), WM_DYNO_DELETE, 0, 0);
  198.               WinSendMsg(WinWindowFromID(hWndDlg, FID_MINMAX      ), WM_DYNO_DELETE, 0, 0);
  199.  
  200.               WinDismissDlg(hWndDlg, TRUE);
  201.               break;
  202.  
  203.          case WM_COMMAND:
  204.               switch (SHORT1FROMMP(mp1))
  205.                  {
  206.                   case PB_THREAD_1:
  207.                        WinQueryDlgItemShort(hWndDlg, EF_NUMBER, (PSHORT)&usTotal, FALSE);
  208.  
  209.                        /*____________________________________
  210.                        |                                     |
  211.                        | Show what DynoHelp can do... (Change|
  212.                        | text of help item, before thread,   |
  213.                        | and then change it back when it's   |
  214.                        | done.)                              |
  215.                        |____________________________________*/
  216.                        strcpy(szTmp, HTX_PB_THREAD_1);
  217.                        strcat(szTmp, " (again)");
  218.  
  219.                        WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_1     ), WM_DYNO_CHANGE, (MPARAM)szTmp, 0);
  220.  
  221.                        /*____________________________________
  222.                        |                                     |
  223.                        | Call the ProcessTest function,      |
  224.                        | using usTotal as the parm, via      |
  225.                        | the PowerHABCall. This function call|
  226.                        | will not return until PocessTest    |
  227.                        | is finished.                        |
  228.                        |____________________________________*/
  229.                        PowerHABCall(hAB, ProcessTest, (PVOID)&usTotal);
  230.  
  231.                        WinMessageBox(HWND_DESKTOP,
  232.                                      hWndDlg,
  233.                                      "The thread has finished processing.",
  234.                                      "Thread - Type 1",
  235.                                      0,
  236.                                      MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE);
  237.  
  238.                        /*____________________________________
  239.                        |                                     |
  240.                        | Change the help text back to what   |
  241.                        | it was.                             |
  242.                        |____________________________________*/
  243.                        WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_1     ), WM_DYNO_CHANGE, (MPARAM)HTX_PB_THREAD_1, 0);
  244.  
  245.                        return (MPARAM)(TRUE);
  246.                        break;
  247.  
  248.                   case PB_THREAD_2:
  249.                        WinQueryDlgItemShort(hWndDlg, EF_NUMBER, (PSHORT)&usTotal, FALSE);
  250.  
  251.                        /*____________________________________
  252.                        |                                     |
  253.                        | Show what DynoHelp can do... (Change|
  254.                        | text of help item, before thread,   |
  255.                        | and then change it back when it's   |
  256.                        | done.)                              |
  257.                        |____________________________________*/
  258.                        strcpy(szTmp, HTX_PB_THREAD_2);
  259.                        strcat(szTmp, " (again)");
  260.                        WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_2     ), WM_DYNO_CHANGE, (MPARAM)szTmp, 0);
  261.  
  262.                        /*____________________________________
  263.                        |                                     |
  264.                        | Call the ProcessTest function,      |
  265.                        | using usTotal as the parm, via      |
  266.                        | the PowerCall. This function call   |
  267.                        | will not return until PocessTest    |
  268.                        | is finished.                        |
  269.                        |____________________________________*/
  270.                        PowerCall(ProcessTest, (PVOID)&usTotal);
  271.  
  272.                        WinMessageBox(HWND_DESKTOP,
  273.                                      hWndDlg,
  274.                                      "The thread has finished processing.",
  275.                                      "Thread - Type 2",
  276.                                      0,
  277.                                      MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE);
  278.  
  279.                        /*____________________________________
  280.                        |                                     |
  281.                        | Change the help text back to what   |
  282.                        | it was.                             |
  283.                        |____________________________________*/
  284.                        WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_2     ), WM_DYNO_CHANGE, (MPARAM)HTX_PB_THREAD_2, 0);
  285.  
  286.                        return (MPARAM)(TRUE);
  287.                        break;
  288.  
  289.                   case PB_THREAD_3:
  290.                        WinQueryDlgItemShort(hWndDlg, EF_NUMBER, (PSHORT)&usTotal, FALSE);
  291.  
  292.                        /*____________________________________
  293.                        |                                     |
  294.                        | Show what DynoHelp can do... (Change|
  295.                        | text of help item, before thread,   |
  296.                        | and then change it back when it's   |
  297.                        | done.)                              |
  298.                        |____________________________________*/
  299.                        strcpy(szTmp, HTX_PB_THREAD_3);
  300.                        strcat(szTmp, " (again)");
  301.                        WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_3     ), WM_DYNO_CHANGE, (MPARAM)szTmp, 0);
  302.  
  303.                        /*____________________________________
  304.                        |                                     |
  305.                        | Call the ProcessTest function,      |
  306.                        | using usTotal as the parm, via      |
  307.                        | the PowerCall. This function call   |
  308.                        | will not return until PocessTest    |
  309.                        | is finished.                        |
  310.                        |____________________________________*/
  311.                        PowerCall2(ProcessTest, (PVOID)&usTotal);
  312.  
  313.                        WinMessageBox(HWND_DESKTOP,
  314.                                      hWndDlg,
  315.                                      "The thread has finished processing.",
  316.                                      "Thread - Type 3",
  317.                                      0,
  318.                                      MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE);
  319.  
  320.                        /*____________________________________
  321.                        |                                     |
  322.                        | Change the help text back to what   |
  323.                        | it was.                             |
  324.                        |____________________________________*/
  325.                        WinSendMsg(WinWindowFromID(hWndDlg, PB_THREAD_3     ), WM_DYNO_CHANGE, (MPARAM)HTX_PB_THREAD_3, 0);
  326.  
  327.                        return (MPARAM)(TRUE);
  328.                        break;
  329.  
  330.                   case PB_NO_THREAD:
  331.                        WinQueryDlgItemShort(hWndDlg, EF_NUMBER, (PSHORT)&usTotal, FALSE);
  332.  
  333.                        /*____________________________________
  334.                        |                                     |
  335.                        | Call the ProcessTest function,      |
  336.                        | using usTotal as the parm.  It will |
  337.                        | lock up the desktop, until it       |
  338.                        | returns.                            |
  339.                        |____________________________________*/
  340.                        ProcessTest(&usTotal);
  341.  
  342.                        WinMessageBox(HWND_DESKTOP,
  343.                                      hWndDlg,
  344.                                      "The function call has finished processing.",
  345.                                      "No Thread",
  346.                                      0,
  347.                                      MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE);
  348.  
  349.                        return (MPARAM)(TRUE);
  350.                        break;
  351.  
  352.                   case DID_CANCEL:
  353.                        WinDismissDlg(hWndDlg, TRUE);
  354.                        break;
  355.                  }
  356.               break;
  357.       }
  358.  
  359. return WinDefDlgProc(hWndDlg,
  360.                         msg,
  361.                         mp1,
  362.                         mp2);
  363. }
  364.  
  365. /*__________________________________________________________________________
  366. |                                                                           |
  367. |    Function: ProcessTest                                                  |
  368. |                                                                           |
  369. | Description: Stub function to demo the differct threaded/no-threading     |
  370. |              calls.  The function you pass to the threading calls should  |
  371. |              be define as:                                                |
  372. |                                                                           |
  373. |               <Ret Value> pascal <FunctionName>(<Parm List>)          |
  374. |                                                                           |
  375. |              When calling though the PowerThread, you can do just         |
  376. |              about anything you can do when it's non-threaded.  Remember, |
  377. |              if you want to do any WinSendMsg (or any other Win calls,    |
  378. |              excluding WinPostMsg), you'll need to create a message       |
  379. |              queue for this thread.                                       |
  380. |                                                                           |
  381. |      Return: SHORT                                                        |
  382. |                                                                           |
  383. | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
  384. |                            C H A N G E    L O G                           |
  385. | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
  386. |                                                                           |
  387. |  PRG.    DATE       DESCRIPTION                                           |
  388. |  ----    ---------- ---------------------------------------------------   |
  389. |  RATAJIK 10-01-1994 Initial Developement                                  |
  390. |__________________________________________________________________________*/
  391. INT _System ProcessTest(USHORT *pusTest)
  392. {
  393.  INT j = *pusTest;
  394.  
  395.  /*____________________________________
  396.  |                                     |
  397.  | Loop through j times, sleeping and  |
  398.  | beeping.  When called directly, this|
  399.  | function will lock PM up.  When     |
  400.  | called through the threads, it      |
  401.  | won't! (How cool!)                  |
  402.  |____________________________________*/
  403.  while(j)
  404.     {
  405.      j--;
  406.      DosSleep(1500L);
  407.      DosBeep(101,1);
  408.     }
  409. }
  410.  
  411.  
  412. HSWITCH AddTask(HWND hWndDlg, CHAR *szSwitchTitle, USHORT usID)
  413. {
  414. SWCNTRL  swctlSwitchList;
  415. PID      pid;
  416.  
  417.  WinQueryWindowProcess(hWndDlg, &pid, NULL);
  418.  
  419.  strcpy(swctlSwitchList.szSwtitle, szSwitchTitle);
  420.  
  421.  swctlSwitchList.hwnd          = hWndDlg;
  422.  swctlSwitchList.hwndIcon      = (HWND)usID;
  423.  swctlSwitchList.hprog         = (ULONG)NULL;
  424.  swctlSwitchList.idProcess     = pid;
  425.  swctlSwitchList.idSession     = (USHORT)0;
  426.  swctlSwitchList.uchVisibility = SWL_VISIBLE;
  427.  swctlSwitchList.fbJump        = SWL_JUMPABLE;
  428.  
  429.  return(WinAddSwitchEntry(&swctlSwitchList));
  430. }
  431.  
  432. /*__________________________________________________________________________
  433. |                                        |
  434. |     Function: Dynamically Load the PM-superset stuff                      |
  435. |                                        |
  436. |   Decription:                                                             |
  437. |                                        |
  438. |Creation Date: 8-18-94  Written By: Greg Ratajik                           |
  439. |                                        |
  440. |     Notes:                                 |
  441. |                                                                           |
  442. |__________________________________________________________________________*/
  443. BOOL LoadDLLS( VOID )
  444. {
  445. APIRET   apiRet;
  446. CHAR     szFailName[CCHMAXPATH];
  447. CHAR     szError[CCHMAXPATH];
  448. CHAR     szTmp[CCHMAXPATH];
  449. HMODULE  hmodDyno;
  450. USHORT   usVersion;
  451.  
  452.  DynoCreateHelp  = NULL;
  453.  
  454.  memset(szError, 0, sizeof(szError));
  455.  
  456.  if((apiRet = DosLoadModule( szFailName,           /* failure name buffer         */
  457.                              sizeof( szFailName ), /* size of failure name buffer */
  458.                              DYNO_MODULE_NAME,     /* module name                 */
  459.                              &hmodDyno)))          /* address of handle           */
  460.      {
  461.       strcpy(szTmp, DYNO_MODULE_NAME);
  462.       sprintf(szTmp, "(Load Error code #%u) %s, \n", apiRet, szFailName);
  463.       strcat(szError, szTmp);
  464.      }
  465.  else
  466.     {
  467.      if((apiRet = DosQueryProcAddr(hmodDyno,
  468.                                    0,
  469.                                    DYNO_VERSION_NAME,
  470.                                    &DynoGetVersion)))
  471.         {
  472.          sprintf(szTmp, "(Get Function Error code #%u) %s, \n", apiRet, DYNO_VERSION_NAME);
  473.          strcat(szError, szTmp);
  474.         }
  475.      else
  476.         {
  477.          usVersion = DynoGetVersion();
  478.          if(usVersion != DYNO_MAJOR_VERSION)
  479.              {
  480.               sprintf(szTmp, "(Version Mismatch on DLL) DYNOHELP.DLL Version = %u, EasyCD uses Version %u, \n", usVersion, DYNO_MAJOR_VERSION);
  481.               strcat(szError, szTmp);
  482.              }
  483.          else
  484.             {
  485.               if((apiRet = DosQueryProcAddr(hmodDyno,
  486.                                             0,
  487.                                             DYNO_CREATE_NAME,
  488.                                             &DynoCreateHelp)))
  489.                  {
  490.                   sprintf(szTmp, "(Get Function Error code #%u) %s, \n", apiRet, DYNO_CREATE_NAME);
  491.                   strcat(szError, szTmp);
  492.                  }
  493.             }
  494.         }
  495.     }
  496.  
  497.  if(szError[0] != 0)
  498.     {
  499.       PCHAR tmp;
  500.       CHAR szTmp[600];
  501.  
  502.       if(tmp = strrchr(szError, ','))
  503.           *tmp = '.';
  504.  
  505.       strcat(szError, "\n");
  506.  
  507.       strcpy(szTmp, "PowerCalls TEST was unable to load a DLL. ");
  508.       strcat(szTmp, "The errors returned while loading/initilizing where:\n\n");
  509.       strcat(szTmp, szError);
  510.  
  511.       WinMessageBox(HWND_DESKTOP, HWND_DESKTOP,
  512.                     szTmp,
  513.                     "Load Error",
  514.                     0,
  515.                     MB_OK|MB_ICONEXCLAMATION);
  516.  
  517.      return(FALSE);
  518.     }
  519.  
  520. return(TRUE);
  521. }
  522.