Changeset 1339 for trunk/dll/arccnrs.c


Ignore:
Timestamp:
Dec 14, 2008, 3:55:04 AM (17 years ago)
Author:
Gregg Young
Message:

Waitchild changes to allow sourcefile and line of actual caller to be passed; use MaxComLineStrg for comannd line string length; allow msg for PostMsg to be passed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1335 r1339  
    174174typedef struct {
    175175
    176   CHAR   filename[CCHMAXPATH];   //file passed as MP1 message parameter (file selected)
    177176  HWND   hwndCnr;                //hwnd you want the message posted to
    178177  HWND   hwndClient;             //hwnd calling this thread; NULL will work
    179178  ULONG  RunFlags;               //runemf2 flags see systemf.h
    180   CHAR   *pszDirectory;
    181   CHAR   *pszEnvironment;
     179  ULONG  msg;                    //Message to post
     180  UINT   uiLineNumber;
     181  PCSZ   pszSrcFile;
     182  CHAR   filename[CCHMAXPATH];   //file passed as MP1 message parameter (file selected)
     183  CHAR   *pszDirectory;          //Execution directory
     184  CHAR   *pszEnvironment;        //Enviroment -- NULL passes current
     185  CHAR   *pszCmdLine;             //Use sprintf to format multipart command line into single string
    182186  CHAR   formatstring[40];       //Usally "%s"
    183   CHAR   CmdLine[1024];          //Use sprintf to format multipart command line into single string
    184187}
    185188WAITCHILD;
     
    208211      IncrThreadUsage();
    209212      priority_normal();
    210       ret = runemf2(WaitChild->RunFlags, WaitChild->hwndClient, pszSrcFile, __LINE__,
     213      ret = runemf2(WaitChild->RunFlags, WaitChild->hwndClient,
     214                    WaitChild->pszSrcFile, WaitChild->uiLineNumber,
    211215                    WaitChild->pszDirectory, WaitChild->pszEnvironment,
    212                     WaitChild->formatstring, WaitChild->CmdLine);
     216                    WaitChild->formatstring, WaitChild->pszCmdLine);
    213217      if (ret != -1) {
    214218        if (IsFile(WaitChild->filename) == 1)
    215           PostMsg(WaitChild->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID);
     219          PostMsg(WaitChild->hwndCnr, WaitChild->msg, MPFROMP(filename), MPVOID);
    216220      }
    217221      DecrThreadUsage();
     
    220224    xfree(WaitChild->pszDirectory, pszSrcFile, __LINE__);
    221225    xfree(WaitChild->pszEnvironment, pszSrcFile, __LINE__);
     226    xfree(WaitChild->pszCmdLine, pszSrcFile, __LINE__);
    222227    free(WaitChild);
    223228  } // if WaitChild
     
    15851590
    15861591      WaitChild = xmallocz(sizeof(WAITCHILD), pszSrcFile, __LINE__);
     1592      WaitChild->pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
    15871593      if (!WaitChild)
    15881594        return 0;
     
    15931599          return 0;
    15941600        }
    1595         sprintf(WaitChild->CmdLine, "%s %s %s",
    1596                                     dcd->info->exwdirs ? dcd->info->exwdirs :
    1597                                     dcd->info->extract,
    1598                                     BldQuotedFileName(szQuotedArcName, dcd->arcname),
    1599                                     BldQuotedFileName(szQuotedMemberName, s));
    1600         /*runemf2(SEPARATE | ASYNCHRONOUS | WAIT |
    1601                 (fArcStuffVisible ? 0 : BACKGROUND),
    1602                 , pszSrcFile, __LINE__, dcd->workdir, NULL,
    1603                 "%s %s %s",
    1604                 dcd->info->exwdirs ? dcd->info->exwdirs :
    1605                                      dcd->info->extract,
     1601        sprintf(WaitChild->pszCmdLine, "%s %s %s",
     1602                dcd->info->exwdirs ? dcd->info->exwdirs :
     1603                dcd->info->extract,
    16061604                BldQuotedFileName(szQuotedArcName, dcd->arcname),
    1607                 BldQuotedFileName(szQuotedMemberName, s));*/
     1605                BldQuotedFileName(szQuotedMemberName, s));
    16081606        if (!dcd->info->exwdirs) {
    16091607          p = s;
     
    16271625        WaitChild->RunFlags = SEPARATE | ASYNCHRONOUS | WAIT |
    16281626                              (fArcStuffVisible ? 0 : BACKGROUND);
    1629         WaitChild->hwndClient = dcd->hwndClient;
     1627        WaitChild->hwndClient = dcd->hwndClient;
     1628        WaitChild->msg = UM_ENTER;
     1629        WaitChild->uiLineNumber = __LINE__;
     1630        WaitChild->pszSrcFile = pszSrcFile;
    16301631        WaitChild->pszDirectory = xstrdup(dcd->workdir, pszSrcFile, __LINE__);
    16311632        WaitChild->pszEnvironment = NULL;
     
    19001901                }
    19011902              }
    1902               z = x;
    1903               runemf2(SEPARATE | WINDOWED | WAIT |
    1904                       (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    1905                       hwnd, pszSrcFile, __LINE__,
    1906                       li->targetpath, NULL, "%s", pszCmdLine);
     1903              z = x;
     1904              runemf2(SEPARATE | WINDOWED | WAIT |
     1905                      (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
     1906                      hwnd, pszSrcFile, __LINE__,
     1907                      li->targetpath, NULL, "%s", pszCmdLine);
    19071908              *endofit = 0;
    19081909            } while (li->list[x]);
Note: See TracChangeset for help on using the changeset viewer.