home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / LNVREM.ZIP / LNREMSRC.EXE / LNREMLCH.C < prev    next >
Text File  |  1993-11-09  |  19KB  |  597 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: lnremlch.c.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitc: 1.24
  8.  */
  9.  
  10. /*
  11.  *  lnremlch.csc
  12.  *  Copyright (c) International Business Machines Corporation
  13.  *  1993
  14.  */
  15.  
  16.  
  17. #define LNRemoteLaunch_Class_Source
  18. #include <lnremlch.ih>
  19.  
  20. CHAR MyID[50];
  21.  
  22. /*                                                     
  23.  *   Launch remote command for one or more nodes
  24.  */
  25.  
  26. SOM_Scope int   SOMLINK RemoteExecPgm(LNRemoteLaunch *somSelf,
  27.         STRING_ARRAY_OBJ *pHier,
  28.         SOMAny *pModel,
  29.         PVOID pAppParm,
  30.         SOMAny *pSelected)
  31. {
  32.     char             fname[] = "RemoteExecPgm -";
  33.     ULONG            ulRC;              // Return code
  34.     STRING_ARRAY_OBJ *Contents;         // Management coll contants
  35.     int              i;                 // Loop control
  36.     PCHAR            pCmdBuf;           // Command buffer
  37.     PCHAR            pCmdTail;          // Command tail buffer
  38.     STARTDATA        *pStartData;       // StartData pointer
  39.     PGCMDSTRUC       pCmdStruc;         // Command struc pointer
  40.     UCHAR            PrgTitle[]="Remote Launch";
  41.     UCHAR            PrgName[256];
  42.     UCHAR            PrgNameCmdExe[]="C:\\OS2\\CMD.EXE";
  43.     UCHAR            ObjBuf[100];
  44.     PSZ              pOutFile;
  45.     APIRET           DosRc;
  46.  
  47.     LNRemoteLaunchData *somThis = LNRemoteLaunchGetData(somSelf);
  48.     LNRemoteLaunchMethodDebug("LNRemoteLaunch","RemoteExecPgm");
  49.  
  50.  
  51.     printf("%s Top of method\n", fname);
  52.  
  53.     // ---------------------------------------------
  54.     //   Allocate program inputs and start data structures 
  55.     //   and fill in the blanks
  56.     // ---------------------------------------------
  57.  
  58.     pCmdBuf = (PCHAR) malloc(PINPUT_SIZE);
  59.     if (pCmdBuf == (PCHAR) NULL) {
  60.        printf("%s malloc failed for command buffer\n", fname);
  61.        return(0);
  62.     } /* endif */
  63.  
  64.     pCmdTail = (PCHAR) malloc(PINPUT_SIZE);
  65.     if (pCmdTail == (PCHAR) NULL) {
  66.        printf("%s malloc failed for command tail buffer\n", fname);
  67.        free(pCmdBuf);
  68.        return(0);
  69.     } /* endif */
  70.  
  71.     pStartData = (STARTDATA *) malloc(sizeof(STARTDATA));
  72.     if (pStartData == (STARTDATA *) NULL) {
  73.        printf("%s malloc failed for startdata structure\n", fname);
  74.        free(pCmdBuf);
  75.        free(pCmdTail);
  76.        return(0);
  77.     } /* endif */
  78.  
  79.     // ---------------------------------------------
  80.     //   Get the command string
  81.     // ---------------------------------------------
  82.     if ((GetCmdString(&pCmdStruc)) != LN_RC_SUCCESSFUL) {
  83.        // No command string - put up error screen
  84.        printf("%s Calling error message routine\n",fname);
  85.        _ErrorMessage(somSelf,
  86.        (ULONG) LN_RC_ERR_NO_CMD,
  87.        fname,
  88.        TRUE);
  89.        printf("%s Return from error message routine\n",fname);
  90.        free(pStartData);
  91.        free(pCmdTail);
  92.        free(pCmdBuf);
  93.        return(0);
  94.     } /* endif */
  95.  
  96.     // ---------------------------------------------
  97.     //   Get fully-qualified module name
  98.     // ---------------------------------------------
  99.     DosRc = DosSearchPath(SEARCH_ENVIRONMENT,
  100.                           "PATH",
  101.                           "svruncmd.exe",
  102.                           PrgName,
  103.                           sizeof(PrgName));
  104.     if (DosRc != 0) {
  105.        printf("%s DosSearchPath return code was %d\n",fname,DosRc);
  106.     } else {
  107.        printf("%s Module name is %s\n",fname,PrgName);
  108.     } /* endif */
  109.     // ---------------------------------------------
  110.     //   Setup DosStartSession control block
  111.     // ---------------------------------------------
  112.     pStartData->Length        = sizeof(STARTDATA);
  113.     pStartData->Related       = SSF_RELATED_INDEPENDENT;
  114.     pStartData->FgBg          = SSF_FGBG_FORE;
  115.     pStartData->TraceOpt      = SSF_TRACEOPT_NONE;
  116.     pStartData->PgmTitle      = PrgTitle;
  117.     pStartData->PgmName       = PrgName;
  118.     pStartData->PgmInputs     = pCmdBuf;
  119.     pStartData->SessionType   = SSF_TYPE_DEFAULT;
  120.     pStartData->TermQ         = 0;
  121.     pStartData->Environment   = 0;
  122.     pStartData->InheritOpt    = SSF_INHERTOPT_PARENT;
  123.     pStartData->IconFile      = 0;
  124.     pStartData->PgmHandle     = 0;
  125.     pStartData->PgmControl    = SSF_CONTROL_VISIBLE | SSF_CONTROL_MAXIMIZE;
  126.     pStartData->InitXPos      = 30;
  127.     pStartData->InitYPos      = 40;
  128.     pStartData->InitXSize     = 200;
  129.     pStartData->InitYSize     = 140;
  130.     pStartData->Reserved      = 0;
  131.     pStartData->ObjectBuffer  = ObjBuf;
  132.     pStartData->ObjectBuffLen = 100;
  133.  
  134.     // ---------------------------------------------
  135.     //   Setup SVRUNCMD parameters
  136.     // ---------------------------------------------
  137.     if (pCmdStruc->Sticky) {
  138.        pStartData->PgmName = PrgNameCmdExe; // Use cmd.exe as prog name
  139.        sprintf(pCmdBuf,"/K %s /c=\"%s \" ",PrgName,pCmdStruc->Cmd);
  140.     } else {
  141.        sprintf(pCmdBuf,"/c=\"%s \" ",pCmdStruc->Cmd);
  142.     } /* endif */
  143.     printf("%s CmdBuf => %s\n",fname,pCmdBuf);
  144.     if (pCmdStruc->TimeOut != (PSZ) NULL) {
  145.        sprintf(pCmdTail," /t=%s ",pCmdStruc->TimeOut);
  146.     } else {
  147.        sprintf(pCmdTail," /t=15 ");
  148.     } /* endif */
  149.     if (pCmdStruc->OutFile != (PSZ) NULL) {
  150.        strcat(pCmdTail,"> ");
  151.        strcat(pCmdTail,pCmdStruc->OutFile);
  152.     } /* endif */
  153.     printf("%s CmdTail => %s\n",fname,pCmdTail);
  154.  
  155.     // ---------------------------------------------
  156.     //   See if we were called from a management collection
  157.     //   or a system
  158.     // ---------------------------------------------
  159.     printf("%s Input class is %s\n", fname,pHier->Array[0]);
  160.     if ((!strcmp(pHier->Array[0],CL_MD_MDL)) ||
  161.         (!strcmp(pHier->Array[0],CL_ALL_SYSTEMS_MDL))) {
  162.       Contents = _ConvertContentsToStringArray(pModel,pSelected);
  163.       printf("%s Selected list count is %d\n", fname,Contents->Count);
  164.  
  165.       for (i=0; i < Contents->Count; i+=2) { // Loop through sel systems
  166.          ulRC = _RemoteCall(somSelf,
  167.                             Contents->Array[i+1],
  168.                             pCmdBuf,
  169.                             pCmdTail,
  170.                             pStartData,
  171.                             FALSE);
  172.       } /* endfor */
  173.     } else {                            // Must be a system
  174.        printf("%s Long name is %s\n", fname,pHier->Array[1]);
  175.        ulRC = _RemoteCall(somSelf,
  176.                           pHier->Array[1], 
  177.                           pCmdBuf,
  178.                           pCmdTail,
  179.                           pStartData,
  180.                           TRUE);
  181.     } /* endif */
  182.  
  183.     // ---------------------------------------------
  184.     //   Clean up allocated buffers
  185.     // ---------------------------------------------
  186.     free(pStartData);
  187.     free(pCmdTail);
  188.     free(pCmdBuf);
  189.     free(pCmdStruc->Cmd);
  190.     if (pCmdStruc->TimeOut != (PSZ) NULL) {
  191.        free(pCmdStruc->TimeOut);
  192.     } /* endif */
  193.     if (pCmdStruc->InFile != (PSZ) NULL) {
  194.        free(pCmdStruc->InFile);
  195.     } /* endif */
  196.     if (pCmdStruc->OutFile != (PSZ) NULL) {
  197.        free(pCmdStruc->OutFile);
  198.     } /* endif */
  199.     free(pCmdStruc);
  200.  
  201.     printf("%s Bottom of method\n", fname);
  202.  
  203.     return (int) 0;
  204. }
  205.  
  206. /*
  207.  *   Issue remote call for one node
  208.  */
  209.  
  210. SOM_Scope int   SOMLINK RemoteCall(LNRemoteLaunch *somSelf,
  211.         PSZ LongName,
  212.         PSZ CmdBuf,
  213.         PSZ CmdTail,
  214.         STARTDATA *pStartData,
  215.         BOOL32 VerboseSwitch)
  216. {
  217.     char fname[] = "RemoteCall -";
  218.     ULONG           ulRC;               // Return code
  219.     PSZ             SystemName;         // Displayable system name
  220.     BOOL32          NameBufferFlag = FALSE;
  221.     ULONG           SessID;
  222.     PID             PID;
  223.     APIRET          DosRc;
  224.     NIDSIDSTRUC     NetIDSysID;         // Net ID & sys ID structure
  225.  
  226.     LNRemoteLaunchData *somThis = LNRemoteLaunchGetData(somSelf);
  227.     LNRemoteLaunchMethodDebug("LNRemoteLaunch","RemoteCall");
  228.  
  229.     printf("%s Top of method\n", fname);
  230.  
  231.     // ---------------------------------------------
  232.     //   Initialize variables 
  233.     // ---------------------------------------------
  234.     SystemName  = (PSZ) NULL;        
  235.     NetIDSysID.NetID = (PSZ) NULL;
  236.     NetIDSysID.SysID = (PSZ) NULL; 
  237.     printf("%s Long name is %s\n", fname,LongName);
  238.     // ---------------------------------------------
  239.     //   Get the icon title text
  240.     // ---------------------------------------------
  241.     printf("%s Calling GetShortName for long name %s\n",fname,LongName);
  242.     if ((GetShortName((PSZ) LongName, SYSTEM, &SystemName)) != OK) {
  243.       //
  244.       //   No short name? Just use long name
  245.       //
  246.       printf("%s Using long name\n", fname);
  247.       SystemName =
  248.                (PSZ) _AllocBuffer(somSelf,strlen(LongName));
  249.       strcpy(SystemName,LongName);
  250.       NameBufferFlag = TRUE;            // Remember I allocated buffer
  251.     } /* endif */
  252.     printf("%s Using name %s\n", fname,SystemName);
  253.     // ---------------------------------------------
  254.     //   Get net ID and system ID
  255.     // ---------------------------------------------
  256.     if ((GetNetIDSysID(LongName,&NetIDSysID)) != LN_RC_SUCCESSFUL) {
  257.        // No system agent - put up error screen
  258.        printf("%s Calling error message routine\n",fname);
  259.        _ErrorMessage(somSelf,
  260.        (ULONG) LN_RC_ERR_NO_AGENT,
  261.        SystemName,
  262.        VerboseSwitch);
  263.        printf("%s Return from error message routine\n",fname);
  264.     } else {                            // We have a net ID and sys ID
  265.        // ---------------------------------------------
  266.        //   Setup SVRUNCMD parameters
  267.        // ---------------------------------------------
  268.        strcat(CmdBuf,"/s=");
  269.        strcat(CmdBuf,NetIDSysID.SysID);
  270.        strcat(CmdBuf," /n=");
  271.        strcat(CmdBuf,NetIDSysID.NetID);
  272.        strcat(CmdBuf,CmdTail);
  273.        printf("%s SVRUNCMD string => %s\n",fname,CmdBuf);
  274.        // ---------------------------------------------
  275.        //   Call DosStartSession 
  276.        // ---------------------------------------------
  277.        printf("%s Calling DosStartSession\n",fname);
  278.        DosRc=DosStartSession(pStartData, &SessID, &PID);
  279.        // DosRc = 0;
  280.        printf("%s Return code from DosStartSession - %d\n",fname,DosRc);
  281.        if (DosRc != 0) {
  282.           printf("%s Calling error message routine\n",fname);
  283.           _ErrorMessage(somSelf,
  284.                         (ULONG) LN_RC_ERR_RCLI,
  285.                         SystemName,
  286.                         VerboseSwitch);
  287.           printf("%s Return from error message routine\n",fname);
  288.        } /* endif */
  289.     } /* endif */
  290.     // ---------------------------------------------
  291.     //   Cleanup buffers
  292.     // ---------------------------------------------
  293.     //
  294.     //    Free icon title save buffer
  295.     //
  296.     if (SystemName != (PSZ) NULL) {
  297.       printf("%s Freeing system name buffer\n",fname);
  298.       if (NameBufferFlag) {           // I allocated the buffer
  299.         _FreeBuffer(somSelf,SystemName);
  300.       } else {                        // View allocated the buffer
  301.         SOMFree(SystemName);
  302.       } /* endif */
  303.     } /* endif */
  304.     //
  305.     //    Free net ID and sys ID buffers
  306.     //
  307.     if (NetIDSysID.NetID != (PSZ) NULL) {
  308.        free(NetIDSysID.NetID);
  309.     } /* endif */
  310.     if (NetIDSysID.SysID != (PSZ) NULL) {
  311.        free(NetIDSysID.SysID);
  312.     } /* endif */
  313.  
  314.     printf("%s Bottom of method\n", fname);
  315.  
  316.     return (int) 0;
  317. }
  318.  
  319. /*
  320.  *   Issue error panels
  321.  */
  322.  
  323. SOM_Scope VOID   SOMLINK ErrorMessage(LNRemoteLaunch *somSelf,
  324.         ULONG ErrorCode,
  325.         PSZ LongName,
  326.         BOOL32 VerboseSwitch)
  327. {
  328.     ULONG rc;
  329.     char fname[] = "ErrorMessage -";
  330.     HAB  hab;                           // PM anchor block handle
  331.     HMQ  hmq;                           // PM message queue handle
  332.  
  333.     LNRemoteLaunchData *somThis = LNRemoteLaunchGetData(somSelf);
  334.     LNRemoteLaunchMethodDebug("LNRemoteLaunch","ErrorMessage");
  335.  
  336.     printf("%s Top of method\n", fname);
  337.  
  338.  
  339.     if (VerboseSwitch) {
  340.     //
  341.     //  Allocate PM stuff
  342.     //
  343.     printf("%s Allocating anchor block\n", fname);
  344.       hab = WinInitialize(0); 
  345.     printf("%s Allocating message queue\n", fname);
  346.       hmq = WinCreateMsgQueue(hab,0); 
  347.       switch (ErrorCode) {
  348.       case LN_RC_ERR_NO_AGENT :
  349.     printf("%s Calling NoAgentProc\n", fname);
  350.          rc = WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, (PFNWP)NoAgentProc,
  351.                         _ModHandle, IDLG_NO_SAGENT, (PVOID) LongName);
  352.     printf("%s Return from NoAgentProc\n", fname);
  353.          break;
  354.       case LN_RC_ERR_NO_CMD :
  355.          rc = WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, (PFNWP)NoCmdProc,
  356.                         _ModHandle, IDLG_NO_CMD, (PVOID) LongName);
  357.          break;
  358.       case LN_RC_ERR_RCLI :
  359.          rc = WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, (PFNWP)RCLIErrProc,
  360.                         _ModHandle, IDLG_RCLI_ERR, (PVOID) LongName);
  361.          break;
  362.       default : 
  363.          break;
  364.       }  /* endswitch */
  365.       //
  366.       //  Clean up PM stuff
  367.       //
  368.     printf("%s Deallocating message queue\n", fname);
  369.       WinDestroyMsgQueue(hmq); 
  370.     printf("%s Deallocating anchor block\n", fname);
  371.       WinTerminate(hab); 
  372.     } /* endif */
  373.  
  374.     printf("%s Bottom of method\n", fname);
  375. }
  376.  
  377.  
  378. /*
  379.  *   Instance setup
  380.  */
  381.  
  382. SOM_Scope void   SOMLINK somInit(LNRemoteLaunch *somSelf)
  383. {
  384.     ULONG rc;
  385.     char fname[] = "somInit -";
  386.     char  LoadError[100];
  387.  
  388.     LNRemoteLaunchData *somThis = LNRemoteLaunchGetData(somSelf);
  389.     LNRemoteLaunchMethodDebug("LNRemoteLaunch","somInit");
  390.  
  391.     sprintf(MyID,"lnremlch - %d -",somSelf);
  392.  
  393.     printf("%s %s Top of method\n",MyID,fname);
  394.  
  395.     parent_somInit(somSelf);
  396.  
  397.     //
  398.     //    Get the module handle and save it for use in the PM procs.
  399.     //
  400.     rc = DosLoadModule(LoadError,
  401.                        sizeof(LoadError),
  402.                        "LNREMLCH",
  403.                        &_ModHandle);
  404.     if (rc != 0) {
  405.       printf("%s DosQueryModuleHandle rc = %d\n",fname,rc);
  406.     } else {
  407.       printf("%s ModuleHandle = %d\n",fname,_ModHandle);
  408.     } /* endif */
  409.  
  410.     printf("%s %s Bottom of method\n",MyID,fname);
  411. }
  412.  
  413.  
  414. /*
  415.  *   Instance cleanup
  416.  */
  417.  
  418. SOM_Scope void   SOMLINK somUninit(LNRemoteLaunch *somSelf)
  419. {
  420.     ULONG rc;
  421.     char fname[] = "somUninit -";
  422.  
  423.     LNRemoteLaunchData *somThis = LNRemoteLaunchGetData(somSelf);
  424.     LNRemoteLaunchMethodDebug("LNRemoteLaunch","somUninit");
  425.  
  426.     printf("%s %s Top of method\n",MyID,fname);
  427.  
  428.     rc = DosFreeModule(_ModHandle);
  429.  
  430.     printf("%s %s Bottom of method\n",MyID,fname);
  431.  
  432.     parent_somUninit(somSelf);
  433. }
  434.  
  435. // ----------------------------------------------------------------------
  436. // NoCmdProc
  437. // 
  438. // This PM procedure displays the panel for the command not found case
  439. // ----------------------------------------------------------------------
  440. MRESULT EXPENTRY NoCmdProc(HWND hWndDlg,
  441.                            USHORT message, 
  442.                            MPARAM mp1, 
  443.                            MPARAM mp2)
  444. {
  445.  
  446.  PSZ     SysName;
  447.  MRESULT fpRC = (MRESULT) FALSE;
  448.  CHAR description[256];
  449.  USHORT usRc;                  /* Function return code         */
  450.  char fname[] = "NoCmdProc -";
  451.  
  452.  
  453.  switch(message)
  454.    {
  455.      case WM_INITDLG:
  456.          SysName = (PSZ) mp2;
  457.          WinSetDlgItemText(hWndDlg, NOCMD_TX_NNAME, SysName);
  458.          printf("%s Received %s\n", fname, SysName);
  459.          fpRC = (MRESULT) TRUE;
  460.          break;
  461.  
  462.     case WM_COMMAND:
  463.          switch(SHORT1FROMMP(mp1))
  464.          {
  465.             case NOCMD_PB_OK:  //Ok
  466.                 WinDismissDlg(hWndDlg, FALSE);
  467.              break;
  468.          }
  469.          break; // End of WM_COMMAND
  470.  
  471.     case WM_CLOSE:
  472.          WinDismissDlg(hWndDlg, FALSE);
  473.          break; // End of WM_CLOSE
  474.  
  475.     default:
  476.          fpRC = WinDefDlgProc(hWndDlg, message, mp1, mp2);
  477.          break;
  478.    }
  479.  
  480.   return fpRC;
  481. }
  482.  
  483.  
  484. // ----------------------------------------------------------------------
  485. // NoAgentProc
  486. // 
  487. // This PM procedure displays the panel for the system agent not found case
  488. // ----------------------------------------------------------------------
  489. MRESULT EXPENTRY NoAgentProc(HWND hWndDlg,
  490.                              USHORT message, 
  491.                              MPARAM mp1, 
  492.                              MPARAM mp2)
  493. {
  494.  
  495.  PSZ     SysName;
  496.  MRESULT fpRC = (MRESULT) FALSE;
  497.  CHAR description[256];
  498.  USHORT usRc;                  /* Function return code         */
  499.  char fname[] = "NoAgentProc -";
  500.  
  501. //    printf("%s Top of function\n", fname);
  502.  
  503.  
  504.  
  505.  switch(message)
  506.    {
  507.      case WM_INITDLG:
  508.     printf("%s Case WM_INITDLG\n", fname);
  509.          SysName = (PSZ) mp2;
  510.          WinSetDlgItemText(hWndDlg, NSAGT_TX_NNAME, SysName);
  511.          printf("%s Received %s\n", fname, SysName);
  512.          fpRC = (MRESULT) TRUE;
  513.          break;
  514.  
  515.     case WM_COMMAND:
  516.     printf("%s Case WM_COMMAND\n", fname);
  517.          switch(SHORT1FROMMP(mp1))
  518.          {
  519.             case NSAGT_PB_OK:  //Ok
  520.                 WinDismissDlg(hWndDlg, FALSE);
  521.              break;
  522.          }
  523.          break; // End of WM_COMMAND
  524.  
  525.     case WM_CLOSE:
  526.     printf("%s Case WM_CLOSE\n", fname);
  527.          WinDismissDlg(hWndDlg, FALSE);
  528.          break; // End of WM_CLOSE
  529.  
  530.     default:
  531. //    printf("%s Default case\n", fname);
  532.          fpRC = WinDefDlgProc(hWndDlg, message, mp1, mp2);
  533.          break;
  534.    }
  535.  
  536. //    printf("%s Bottom of function\n", fname);
  537.  
  538.  
  539.   return fpRC;
  540. }
  541.  
  542.  
  543. // ----------------------------------------------------------------------
  544. // RCLIErrProc
  545. // 
  546. // This PM procedure displays the panel for a DosStartSession or RCLI error
  547. // ----------------------------------------------------------------------
  548. MRESULT EXPENTRY RCLIErrProc(HWND hWndDlg,
  549.                              USHORT message, 
  550.                              MPARAM mp1, 
  551.                              MPARAM mp2)
  552. {
  553.  
  554.  PSZ     SysName;
  555.  MRESULT fpRC = (MRESULT) FALSE;
  556.  CHAR description[256];
  557.  USHORT usRc;                  /* Function return code         */
  558.  char fname[] = "RCLIErrProc -";
  559.  
  560.  
  561.  switch(message)
  562.    {
  563.      case WM_INITDLG:
  564.          SysName = (PSZ) mp2;
  565.          WinSetDlgItemText(hWndDlg, RCERR_TX_NNAME, SysName);
  566.          printf("%s Received %s\n", fname, SysName);
  567.          fpRC = (MRESULT) TRUE;
  568.          break;
  569.  
  570.     case WM_COMMAND:
  571.          switch(SHORT1FROMMP(mp1))
  572.          {
  573.             case RCERR_PB_OK:  //Ok
  574.                 WinDismissDlg(hWndDlg, FALSE);
  575.              break;
  576.          }
  577.          break; // End of WM_COMMAND
  578.  
  579.     case WM_CLOSE:
  580.          WinDismissDlg(hWndDlg, FALSE);
  581.          break; // End of WM_CLOSE
  582.  
  583.     default:
  584.          fpRC = WinDefDlgProc(hWndDlg, message, mp1, mp2);
  585.          break;
  586.    }
  587.  
  588.   return fpRC;
  589. }
  590.  
  591. #pragma linkage (SOMInitModule, system)
  592.  
  593. void SOMInitModule(integer4 MajorVersion, integer4 MinorVersion)
  594. {
  595.  LNRemoteLaunchNewClass(0,0);  
  596. }
  597.