home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / ACDCR032.ZIP / source / launchers / lnchmkis.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-08  |  2.0 KB  |  75 lines

  1. /* This wrapper prog starts mkisofs to create an ISO-Image
  2.  */
  3. /*
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2, or (at your option)
  7.  * any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; see the file COPYING.  If not, write to
  16.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  */
  18. #define INCL_DOS
  19. #define INCL_WIN
  20.  
  21. #include <os2.h>
  22. #include <time.h>
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26. #include <io.h>
  27.  
  28. void main(int argc, char * argv[])
  29. {
  30.     int i;
  31.     char cmdLine[CCHMAXPATH*4]={0};
  32.     HWND hwndNotify;
  33.     char * chrPtr;
  34.     char exeName[CCHMAXPATH];//="g:\\projects_working\\audiocpy\\cdrecord.exe";
  35.     char chrError[CCHMAXPATH];
  36.     RESULTCODES resultCodes;
  37.     ULONG rc,ulAction;
  38.     PVOID pvSharedMem;
  39.     char *text;
  40.  
  41.     hwndNotify=atol(argv[1]);
  42.  
  43.  
  44.     if(!DosGetNamedSharedMem(&pvSharedMem,"\\SHAREMEM\\MKISOFSCMDLINE",PAG_READ|PAG_WRITE))
  45.       {
  46.         text=(char*)pvSharedMem;
  47.         /* Build mkisofs cmd-line */
  48.         /* Second zero to mark end */
  49.  
  50.         //*(strrchr(text,0)+1)=0;
  51.         *(strchr(text,0)+1)=0;
  52.         
  53.         *strchr(text,' ')=0;       
  54.  
  55.         /* start mkisofs */
  56.         DosExecPgm(chrError,sizeof(chrError),EXEC_SYNC,text,0,&resultCodes,text);
  57.         
  58.         /* printf("%s\n",pvSharedMem);
  59.         printf("%s",text2);
  60.         DosSleep(10000);*/
  61.         DosFreeMem(pvSharedMem);
  62.       }
  63.     /* Send msg. to the notification window */
  64.     WinPostMsg(hwndNotify,WM_APPTERMINATENOTIFY,MPFROMLONG(0),MPFROMLONG(resultCodes.codeResult));
  65. }
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.