Board index » cppbuilder » WinExec prblem
Partaud
![]() CBuilder Developer |
WinExec prblem2005-10-26 04:55:36 PM cppbuilder95 Hello, I try to use WinExec method to use it with the "rar.exe" compressor. or "winrar" is it the good way? Question is there another method to launch exe files with arguments?(but not as complicated than "CreateProcess" I have looked at the Window SDK and C++ library and have not find compression methods or algorithms is it normal? I have tried with rar.exe and winrar.exe My code is : //------------------------------------------------------- char nomacopi[100]; AnsiString arguments,nomagicler,chemapplic; chemapplic=ExtractFilePath(Application->ExeName); // nomrar is read in a TStringList nomagicler=chemapplic+nomrar+".rar"; //Erasing existing rar file if(FileExists(nomagicler))DeleteFile(nomagicler); //command //rarfiles.lst is build from a TStringList containing directories path arguments=chemapplic+"winrar a "+nomrar+" @rarfiles.lst"; strcpy(nomacopi,arguments.c_str()); WinExec(nomacopi,SW_HIDE); //---------------------------------------------------------- The program stops in the WinExec command and show the CPU windows stopped in the rar.exe thread. (I don't understand the cpu window and how to use it) I have try it in the command line window and rar works fine I have tried wrinting the exact path in two cotes in the WinExec's first argument =>nothing is created I have tried with "argumen.c_str() in the first argument too but it stop at the cpu window too If you have any idea say to me please Or if you have an other way to compress directories!!!! I thank you very much in advance And excuse my English Patrick |