SQLExpress - Xb2.NET     ot4xb  
ot4xb.public
Support for 7z
Thread Starter: bengt.ovelius Started: 4/27/2007 6:20 AM UTC
Replies: 5
Support for 7z
On this link you can read FAQ
http://www.7-zip.org/faq.html

How can I add support for 7z archives to my application?
One way is to use the 7za.dll (available from sf.net for download). The 7za.dll works via COM interfaces. It, however, doesn't use standard COM interfaces for creating objects. You can find a small example in the source code. A full example is 7-Zip itself, since 7-Zip works via this dll also. There are other applications that use 7za.dll such as WinRAR, PowerArchiver and others.The other way is to call the command line version: 7za.exe.

Pablo,

how hard or easy is it to write a wrapper that calls 7za.dll from XBASE ? 7z seems to offer things that xbZlib

is still missing, like encryptation.  I don't know how good this idea is, looking forward to your comments

Best regards/ Bengt Ovelius
Re: Support for 7z
It was a bit hard to find the 7za.dll , but here it is.

http://prdownloads.sourceforge.net/sevenzip/7z423_extra.tar.bz2?download

The latest version of WinRAR uses 7zxa.dll from this package
(2005)
Re: Support for 7z
Hi Bengt,

I've just taked a quick look to the source code.


7za.dll works via COM interfaces. It, however, doesn't use standard COM interfaces for creating objects. You can find a small example in the source code. A full example is 7-Zip itself, since 7-Zip works via this dll also.

The dll export a function called CreateObject() that instantiate the interfaces without the need to register them into the system. It's a curious technique I'm still not sure if a good or bad idea :-)

how hard or easy is it to write a wrapper that calls 7za.dll from XBASE ?

With ot4xb.dll and the xppcbk.exe callback compiler it's posible to create the interfaces that 7za need to work, you will need to create the proxi callbacks with xppcbk and store them into the corresponding interfaces with PokeDWord() from ot4xb.dll

The 7zip interfaces are not derived from IDispatch, so you will need to get the function pointers with PeekDWord()

It's posible to make the wrappers using only PRGs, but I think can be a bit complex and maybe will not run as fast as you expect, because some methods you will need to provide will be called so frecuently and Xbase++ will add some extra overhead with every call.

In my opinion will not be a good idea.

The other option is modify the C++ sources from the 7zip console dir and make a Xbase++  dll using the C Api. ot4xbcpp.lib  provide a C++ class called TXbClass that allow you to create Xbase++ classes from C++

There are other applications that use 7za.dll such as WinRAR, PowerArchiver and others.
Using C++ smart pointers it's so easy to implement clients for 7za.dll

The other way is to call the command line version: 7za.exe.
Probably the fast and simple way, in the Phil's site you can found a tool to redirect stdout from a child process to a string so you can capture the 7zip.exe output and show it in your app

7z seems to offer things that xbZlib
is still missing, like encryptation.  I don't know how good this idea is,

In clipper/fw days I was used DynaZip with good results, and quite simple to use. BTW the zip folders in Windows XP is performed by this engine.
www.innermedia.com

Regards,
Pablo Botella
Re: Support for 7z
Tell me, why not using the Brend Dubs azip wrapper ?
Best Regards
Osvaldo Ramirez

Hi
I am using it and it is probably the best alternative so far.  But it has limitations.
No alternative is near the PKZIP ver 4.5 command line  from 2001  -  fast,
big zip-archives, encrypt, move files etc.... But it is licensed and not sold anymore.

xbZlib is the only one that can compress strings in memory - great !

I am just looking for something like PKZIP 4.5 that can be integrated into XBASE,
without the limitations of AddZIP and xbZlib
7z could perhaps be a candidate,

Best regards
Bengt Ovelius
Re: Support for 7z
Hi bengt.ovelius

Tell me, why not using the Brend Dubs azip wrapper ?

Best Regards
Osvaldo Ramirez


> The other way is to call the command line version: 7za.exe.
> Probably the fast and simple way, in the Phil's site you can found a tool > to redirect stdout from a child process to a string so you can capture the > 7zip.exe output and show it in your app
This sounds interesting - any idear about the name of the tool?
Have a nice weekend
Bengt  
Re: Support for 7z
Bengt,

>The other way is to call the command line version: 7za.exe.
>Probably the fast and simple way, in the Phil's site you can found a tool >to redirect stdout from a child process to a string so you can capture the >7zip.exe output and show it in your app
This sounds interesting - any idear about the name of the tool?

Shell2Buffer - #75

Regards,
-- Phil Ide

---------------------
www.xbhcl.com
www.pbih.eu
www.idep.org.uk/xbase
---------------------
Escort GT - An oxymoron