CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: UnRAR.dll

  1. #1
    Join Date
    May 1999
    Posts
    1

    UnRAR.dll

    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++?)
    %

  2. #2
    Join Date
    Dec 2002
    Location
    at home and at office :D
    Posts
    126

    Question

    I'm looking for winrar-examples. Where to find it ?

  3. #3
    Join Date
    May 2002
    Location
    Russia
    Posts
    1,571
    WinExec("rar -e filename.rar");

    )

  4. #4
    Join Date
    Dec 2002
    Location
    at home and at office :D
    Posts
    126

    Thumbs up

    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.
    Last edited by ozzy66; December 18th, 2002 at 10:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured