Click to See Complete Forum and Search --> : UnRAR.dll


Nitro957
May 2nd, 1999, 09:53 AM
I am trying to make a program to extract the contents of a .rar file. Here is what a converted from C to C++. (I am still using the unrar.lib from the example in the WinRAR example, should that be good for C++?)
%

ozzy66
December 18th, 2002, 01:54 AM
I'm looking for winrar-examples. Where to find it ? :confused:

alexey_1979
December 18th, 2002, 08:38 AM
WinExec("rar -e filename.rar");

:))

ozzy66
December 18th, 2002, 09:46 AM
ok - thanks ;)

meanwhile I found also this lucky peace of code:


CString oStrArchivProg = "c:\programs\winrar\winrar.exe";

if ( oStrArchivProg.GetLength() > 0 )
{
BOOL bOk = FALSE;
STARTUPINFO si = {0}; // Initialize all members to zero
si.cb = sizeof(STARTUPINFO); // Set byte count
si.dwFlags = STARTF_USESHOWWINDOW; //to be able to set wShowWindow
si.wShowWindow = SW_MAXIMIZE;
PROCESS_INFORMATION pi;

oStrArchivProg += " e \"c:\\*.rar\" \"c:\\"";
// e = extract files from archiv
// => "c:\programs\winrar\winrar.exe" e "c:\*.rar" "c:\"
// oStrArchivProg has to have the same syntax like winrar calling within a MS-DOS-Box

bOK = CreateProcess
(
NULL,// address of module name
oStrArchivProg.GetBuffer(0), // address of command line
NULL, // address of process security attributes
NULL, // address of thread security attributes
TRUE, // new process inherits handles
CREATE_DEFAULT_ERROR_MODE, // creation flags
NULL, // address of new environment block
NULL, // address of current directory name
&si, // address of STARTUPINFO
&pi // address of PROCESS_INFORMATION
);

...
}


Nothing special I think - the only thing to remind is, that the call of CreateProcess can be compared with a call in a MS-DOS-Box.