Article View: borland.public.cppbuilder.nativeapi
Article #5007WinExec prblem
From: Partaud
Date: Wed, 26 Oct 2005 08:55
Date: Wed, 26 Oct 2005 08:55
39 lines
2527 bytes
2527 bytes
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
Technical Details
Message-ID:
<435f4688$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4d0da69c9ad9d000,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Partaud" <patartaud@wanadoo.fr> Newsgroups: borland.public.cppbuilder.nativeapi Subject: WinExec prblem Date: Wed, 26 Oct 2005 10:55:36 +0200 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 82.228.58.174 Message-ID: <435f4688$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130317448 82.228.58.174 (26 Oct 2005 02:04:08 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail