home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odtlktv4.zip / ODTLKT / TOOLKIT / SAMPLES / OPENDOC / PARTS / TTAPE1 / TAPEINST.CMD next >
OS/2 REXX Batch file  |  1995-12-15  |  2KB  |  68 lines

  1. /*****************************************************************/
  2. /*                                                               */
  3. /*  FileName: TapeInst.CMD                                       */
  4. /*                                                               */
  5. /*  Purpose:  Installation command file for the TTAPE1 part.     */
  6. /*            Calls the Opendoc Rexx API to register the part.   */
  7. /*                                                               */
  8. /*  Change History:                                              */
  9. /*                                                               */
  10. /*****************************************************************/
  11. /* add the registration function  ( and utilities )*/
  12.  
  13. SAY " Adding functions ";
  14. call RXFUNCADD 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  15. call SysLoadFuncs
  16.  
  17. call SysCls
  18. SAY
  19. SAY "**************************************"
  20. SAY "*                                    *"
  21. SAY "*  Registering the TickerTape1 Part  *"
  22. SAY "*                                    *"
  23. SAY "**************************************"
  24.  
  25.  
  26.  /* Load the REXX functions */
  27.  
  28.  
  29.  rc = RXFUNCQUERY('ODLoadOpenDocFuncs');
  30.  SAY " rc = " rc;
  31.  IF rc \= 0 then DO
  32.    SAY " Adding ODLoadOpenDocFuncs"
  33.    rc = RXFUNCADD('ODLoadOpenDocFuncs', 'OPENDOC', 'ODLoadOpenDocFuncs');
  34.    SAY " RXFUNCADD rc for ODLoadOpendocFuncs = " rc
  35.       IF rc <  0 THEN DO
  36.         SAY " Unable to add  Opendoc functions, EXITING";
  37.         RETURN;
  38.       END
  39.  END
  40.  
  41. call ODLoadOpenDocFuncs;
  42.  
  43.  
  44.  
  45. className = "TickerTape1Part"
  46. dllName   = "ttape1"
  47. cTemplate = "TRUE"
  48. somIRName = ""
  49.  
  50.  
  51. SAY "Registering TickerTape1 part"
  52.  
  53. rc = ODRegisterPartHandlerClass( className, dllName, cTemplate, somIRName);
  54.  
  55. /* rc of 0 = successfully added, 4 = successfully replaced */
  56.  
  57. IF rc \=  0 & rc \= 4 then do
  58.         call ODUnLoadOpenDocFuncs
  59.         call RxFuncDrop 'ODLoadOpenDocFuncs'
  60.         SAY " Registration failed, rc = " rc;
  61.         return;
  62. end
  63.  
  64.         call ODUnLoadOpenDocFuncs
  65.         call RxFuncDrop 'ODLoadOpenDocFuncs'
  66.         SAY "TickerTape1 part successfully registered";
  67. RETURN
  68.