Board index » cppbuilder » WinExec prblem

WinExec prblem


2005-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
 
 

Re:WinExec prblem

Quote
Or if you have an other way to compress directories!!!!
Cabinet files are easy to make with the Cabinet SDK from MS:
tinyurl.com/daub
The examples show how to call cabinet.ddl functions from your
application.
--
Bruce
 

Re:WinExec prblem

Thank you very much, I think it is the best way than third patry tool.
Thank you again very much
Patrick
" Bruce Salzman" < XXXX@XXXXX.COM >a écrit dans le message de news:
XXXX@XXXXX.COM ...
Quote
>Or if you have an other way to compress directories!!!!

Cabinet files are easy to make with the Cabinet SDK from MS:

tinyurl.com/daub

The examples show how to call cabinet.ddl functions from your application.

--
Bruce

 

{smallsort}

Re:WinExec prblem

Thank you
I have downloaded the SDK, have you an example simple how to use the dll or
where I can find one,
If it exists.
Thank you again
Patrick
" Bruce Salzman" < XXXX@XXXXX.COM >a écrit dans le message de news:
XXXX@XXXXX.COM ...
Quote
>Or if you have an other way to compress directories!!!!

Cabinet files are easy to make with the Cabinet SDK from MS:

tinyurl.com/daub

The examples show how to call cabinet.ddl functions from your application.

--
Bruce