Changeset 122


Ignore:
Timestamp:
Oct 8, 2023, 7:16:57 PM (22 months ago)
Author:
erdmann
Message:

M3UFolder: remove the fruitless attempt to reset the window title with "wpObjM3UFile" object pointer being NULL at the place where it is being referenced ("wpOpen" trap)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars/mediafolder/c/m3ufolder/m3ufolderoverriddenwpmethods.cpp

    r121 r122  
    5757
    5858//void HlpWriteToTrapLog(const char* chrFormat, ...);
    59 
    60 #if 0
    61 void _Optlink rexxThreadFunc (void *arg)
    62 {
    63   HAB  hab;
    64   HMQ  hmq;
    65   QMSG qmsg;
    66   CWM3UFolder *thisPtr;
    67   HWND hwnd;
    68 #if 0
    69   char chrFileName[CCHMAXPATH];
    70   char chrFolderName[CCHMAXPATH];
    71   char chrRexxScript[CCHMAXPATH];
    72 #endif
    73   char *chrFileName;
    74   char *chrFolderName;
    75   char *chrRexxScript;
    76   ULONG ulSize;
    77 
    78   thisPtr=(CWM3UFolder*)arg;
    79   if(!somIsObj(thisPtr))
    80     return;
    81 
    82   if(!somIsObj(thisPtr->wpObjM3UFile))
    83     return;
    84 
    85   chrFileName=thisPtr->wpAllocMem( CCHMAXPATH*3+10 , &ulSize);
    86   if(!chrFileName)
    87     return;
    88 
    89   chrFolderName=chrFileName+CCHMAXPATH+1;
    90   chrRexxScript=chrFolderName+CCHMAXPATH+1;
    91 
    92   ulSize=CCHMAXPATH;
    93   if(!((WPFileSystem*)thisPtr->wpObjM3UFile)->wpQueryRealName(chrFileName, &ulSize, TRUE))
    94     return;
    95 
    96   ulSize=CCHMAXPATH;
    97   if(!thisPtr->wpQueryRealName(chrFolderName, &ulSize, TRUE))
    98     return;
    99 
    100   hab=WinInitialize(0);
    101   if(hab) {
    102     hmq=WinCreateMsgQueue(hab,0);
    103     if(hmq) {
    104       RXSTRING arg[2];                    /* argument string for REXX  */
    105       RXSTRING rexxretval;                /* return value from REXX    */
    106       APIRET   rc;                        /* return code from REXX     */
    107       SHORT    rexxrc = 0;                /* return code from function */
    108 
    109 
    110       sprintf(chrRexxScript,"%s%s",  chrInstallDir,RX_INSERT_PLAYLISTTRACKS);
    111       //HlpWriteToTrapLog("chrRexxScript: %s\n", chrRexxScript);
    112       /* By setting the strlength of the output RXSTRING to zero, we   */
    113       /* force the interpreter to allocate memory and return it to us. */
    114       /* We could provide a buffer for the interpreter to use instead. */
    115       rexxretval.strlength = 0L;          /* initialize return to empty*/
    116 
    117       MAKERXSTRING(arg[0], chrFileName, strlen(chrFileName));/* create input argument     */
    118       MAKERXSTRING(arg[1], chrFolderName, strlen(chrFolderName));/* create input argument     */
    119 
    120       TRY_LOUD(RX_START) {
    121         /* Here we call the interpreter.  We don't really need to use    */
    122         /* all the casts in this call; they just help illustrate         */
    123         /* the data types used.                                          */
    124         rc=RexxStart((LONG)       2,             /* number of arguments   */
    125                      (PRXSTRING)  &arg,          /* array of arguments    */
    126                      (PSZ)        chrRexxScript,/* name of REXX file     */
    127                      //   (PSZ)        "H:\\cwmm\\mediafolder\\beep.cmd",/* name of REXX file     */
    128                      (PRXSTRING)  0,             /* No INSTORE used       */
    129                      (PSZ)        "CWRXX",         /* Command env. name     */
    130                      (LONG)       RXSUBROUTINE,  /* Code for how invoked  */
    131                      (PRXSYSEXIT) 0,             /* No EXITs on this call */
    132                      (PSHORT)     &rexxrc,       /* Rexx program output   */
    133                      (PRXSTRING)  &rexxretval ); /* Rexx program output   */
    134 
    135         if(rc) {
    136           sprintf(chrFileName,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n",
    137                   "", rc*-1);
    138           WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrFileName, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR);
    139         }
    140         DosFreeMem(rexxretval.strptr);          /* Release storage given to us by REXX.  */
    141       }
    142       CATCH(RX_START)
    143         {}END_CATCH;
    144 
    145         WinDestroyMsgQueue(hmq);
    146     }
    147     WinTerminate(hab);
    148   }
    149   thisPtr->fContentsChanged=FALSE;
    150   thisPtr->wpFreeMem((PBYTE)chrFileName);
    151 }
    152 
    153 BOOL CWM3UFolder::wpSetup(PSZ pSetupString)
    154 {
    155   /**************************************************
    156    *                                                *
    157    *                                                *
    158    **************************************************/
    159   char buffer[25];
    160   ULONG bufferSize;
    161 
    162   /* Set object window HWND */
    163   bufferSize=sizeof(buffer);
    164   if(wpScanSetupString(pSetupString, "M3UOBJECTWINDOW", buffer,&bufferSize))
    165     {
    166       hwndObject=atol(buffer);
    167     }
    168 
    169   /* Set object pointer to M3U-File */
    170   bufferSize=sizeof(buffer);
    171   if(wpScanSetupString(pSetupString, "M3UOBJECTHANDLE", buffer,&bufferSize))
    172     {
    173       WPObject *wpObject;
    174 
    175       wpObjM3UFile=NULLHANDLE;
    176       wpObject=(WPObject*)atol(buffer);
    177       if(somIsObj(wpObject))
    178         wpObjM3UFile=wpObject;
    179     }
    180 
    181 
    182   /* FIXME: Use immediate parent here !!!! */
    183   return CWMediaFolder::wpSetup(pSetupString);
    184 }
    185 #endif
    18659
    18760/*****************************************************/
     
    592465      ULONG ulErr;
    593466
    594       /* Remove the title added by XWP */
    595       WinSetWindowText(hwnd, wpObjM3UFile->wpQueryTitle());
    596467      if(!getMessage(text, IDSTR_PLAYLISTVIEWTITLE, sizeof(text), queryResModuleHandle(), HWND_DESKTOP))
    597468        sprintf(text, "Playlist Editor");
Note: See TracChangeset for help on using the changeset viewer.