News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Zipping files without a third party library

Started by jj2007, October 27, 2023, 11:31:45 AM

Previous topic - Next topic

jj2007

Quote from: TimoVJL on November 01, 2023, 11:26:07 PMGlobally shared memory is always problem for that kind of interfaces.

Do you have a link explaining the problem? My suspicion is that with CLSCTX_INPROC_SERVER the memory is local to the process; and I do not see any increase of the working set when not releasing the IShellDispatch interface.

TimoVJL

Is IShellDispatch interface capable to serve CLSCTX_INPROC_SERVER at all ?
Just too big interface with too many features ?
May the source be with you

jj2007

Quote from: TimoVJL on November 02, 2023, 12:31:49 AMIs IShellDispatch interface capable to serve CLSCTX_INPROC_SERVER at all ?

Well, zipping works fine, so obviously it is capable ;-)

jj2007

Google groups, Dec 4, 2007:
QuoteHowever, if there is an empty subdirectory I receive the following error
"The specified directory c:\temp\vbe is empty, so compressed (zipped) folders
cannot add it to the archive.

I tested this by adding an empty folder and using this code:
include \masm32\MasmBasic\MasmBasic.inc
  Init
  Dim Files$() ; redim to empty the Files$() array
  Let Files$(0)="\Masm32\examples\threads"
  ZipFiles "ThreadsTest.zip" ; create zip archive
  ShEx "ThreadsTest.zip" ; open it
EndOfCode

Result: no problem, ZipFiles doesn't complain but you'll see the empty folder in the archive.

Windows internals from the same post:
QuoteWenYuan Wang [MSFT]
unread,
Dec 7, 2007, 8:49:09 AM
to
Hello Rds,
Thanks for your reply.
I consulted shell team. Windows XP or above handles Zip files by
zipfldr.dll (which is located in %windir%\system32\zipfldr.dll). It's a
thrid party product.
I'm sorry to say Microsoft doesn't provide any API to
compress Zip via zipfldr.dll.

The MSDN documentation you referenced about CopyHere method only applies to
normal file system path.It doesn't work for a zip file folder. That's why
you find the option 4 to disable the progress dialog doesn't help.It's by
desgin.

By the way, currently the zip file functionality is only meant to be used
with User Interaction. In other words, programmatically access to the zip
file NSE is not officially supported.

That was almost 16 years ago, and it seems it's still only unofficially supported. It works fine :biggrin: