<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: zlib - Looking the Gift Code in the Mouth</title>
	<link>http://marknelson.us/1997/01/01/zlib-engine/</link>
	<description>Programming, mostly.</description>
	<pubDate>Tue, 09 Mar 2010 22:24:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-323567</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Fri, 05 Mar 2010 12:27:05 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-323567</guid>
		<description>@Zuffi: 

Not without some changes. It compresses files right now.</description>
		<content:encoded><![CDATA[<p>@Zuffi: </p>
<p>Not without some changes. It compresses files right now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zuffi</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-323566</link>
		<dc:creator>Zuffi</dc:creator>
		<pubDate>Fri, 05 Mar 2010 12:25:52 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-323566</guid>
		<description>Hi All,

      If it possible for me to use this ocx to perform a compression of byte array in vb?

Thanks and Best Regards,
Boon Hui</description>
		<content:encoded><![CDATA[<p>Hi All,</p>
<p>      If it possible for me to use this ocx to perform a compression of byte array in vb?</p>
<p>Thanks and Best Regards,<br />
Boon Hui</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-321420</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Fri, 15 Jan 2010 20:25:26 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-321420</guid>
		<description>@cw2k:

Thanks for the excellent support. That OCX is pretty old, it's pretty cool that you are able to get it to still run.

- Mark</description>
		<content:encoded><![CDATA[<p>@cw2k:</p>
<p>Thanks for the excellent support. That OCX is pretty old, it&#8217;s pretty cool that you are able to get it to still run.</p>
<p>- Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cw2k</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-321398</link>
		<dc:creator>cw2k</dc:creator>
		<pubDate>Fri, 15 Jan 2010 02:55:32 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-321398</guid>
		<description>I used ZlibTool.ocx in Visual Basic - and when I ran the program under the VB IDE everything went fine.
But when I compile a *.exe of that program and run it I just get 'welcome' by an error messagebox that says:

"System Error &#38;H80004005. Unknown Error."

Well to shorten the story here is a quick workaround you have to add to each form that uses the ZlibTool: 

[vb]
'Bugfix for ZlibTool.ocx (ZlibTool uses CreateWindowEx(...Class = "msctls_progress32"...) but forget to call that init)
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()

Private Sub Form_Initialize()
    InitCommonControls
End Sub
[/vb]
Since the progressbar is no standard Windows control (like a editbox, label or commandbutton) you need to call InitCommonControls() to setup the windows classes before you can create instances of them - like for ex. one or two CommonControl progressbars.

Of course it's better to fix that problem at its root. But after that you'll need to compile the ZlibTool Project. What may take some time to if you haven't setup/install M$ Visual C++. And maybe some extra time to mess around and fix linker problem such as missing *.lib's unlinked or duplicated exports + fixing changing 'exotic' dll imports like 'MFC42D.DLL' that are not included in the dll's that came with the Windows installation.

So here we go:

zlibtool\ZlibToolCtl.cpp
[c]
...
////////////////////////////////////////////////////////////////////////////
// CZlibToolApp::InitInstance - DLL initialization

BOOL CZlibToolApp::InitInstance()
{
	BOOL bInit = COleControlModule::InitInstance();

	if (bInit)
	{
		// TODO: Add your own module initialization code here.
		InitCommonControls();
	}

	return bInit;
}
...
[/c]

Okay at the end you might ask why the error don't come up when running the program under VB6-IDE?
Well when it's running in the VB6-IDE, it's ran in the same process space as the VB6 IDE and since that IDE also makes use of CommonControls it already has called InitCommonControls() - so the bug will not show any effect.

So that's it.</description>
		<content:encoded><![CDATA[<p>I used ZlibTool.ocx in Visual Basic - and when I ran the program under the VB IDE everything went fine.<br />
But when I compile a *.exe of that program and run it I just get 'welcome' by an error messagebox that says:</p>
<p>"System Error &amp;H80004005. Unknown Error."</p>
<p>Well to shorten the story here is a quick workaround you have to add to each form that uses the ZlibTool: </p>
<div class="igBar"><span id="lvb-1"><a href="#" onclick="javascript:showPlainTxt('vb-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-1">
<div class="vb">
<ol>
<li class="li1">
<div class="de1"><span class="co1">'Bugfix for ZlibTool.ocx (ZlibTool uses CreateWindowEx(...Class = &quot;msctls_progress32&quot;...) but forget to call that init)</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">Private</span> <span class="kw1">Declare</span> <span class="kw1">Sub</span> InitCommonControls Lib <span class="st0">"comctl32.dll"</span> <span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">Private</span> <span class="kw1">Sub</span> Form_Initialize<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; InitCommonControls</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">End</span> <span class="kw1">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Since the progressbar is no standard Windows control (like a editbox, label or commandbutton) you need to call InitCommonControls() to setup the windows classes before you can create instances of them - like for ex. one or two CommonControl progressbars.</p>
<p>Of course it's better to fix that problem at its root. But after that you'll need to compile the ZlibTool Project. What may take some time to if you haven't setup/install M$ Visual C++. And maybe some extra time to mess around and fix linker problem such as missing *.lib's unlinked or duplicated exports + fixing changing 'exotic' dll imports like 'MFC42D.DLL' that are not included in the dll's that came with the Windows installation.</p>
<p>So here we go:</p>
<p>zlibtool\ZlibToolCtl.cpp</p>
<div class="igBar"><span id="lc-2"><a href="#" onclick="javascript:showPlainTxt('c-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-2">
<div class="c">
<ol>
<li class="li1">
<div class="de1">...</div>
</li>
<li class="li2">
<div class="de2"><span class="co1">////////////////////////////////////////////////////////////////////////////</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// CZlibToolApp::InitInstance - DLL initialization</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">BOOL CZlibToolApp::<span class="me2">InitInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; BOOL bInit = COleControlModule::<span class="me2">InitInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>bInit<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// TODO: Add your own module initialization code here.</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; InitCommonControls<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> bInit;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Okay at the end you might ask why the error don't come up when running the program under VB6-IDE?<br />
Well when it's running in the VB6-IDE, it's ran in the same process space as the VB6 IDE and since that IDE also makes use of CommonControls it already has called InitCommonControls() - so the bug will not show any effect.</p>
<p>So that's it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-319731</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Mon, 07 Dec 2009 12:56:07 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-319731</guid>
		<description>@Ashok:

I recommend using the Info-ZIP DLLs. Here's an example:

http://www.vbaccelerator.com/home/Vb/Code/Libraries/Compression/Introduction_to_the_Info-ZIP_Libraries/article.asp</description>
		<content:encoded><![CDATA[<p>@Ashok:</p>
<p>I recommend using the Info-ZIP DLLs. Here's an example:</p>
<p><a href="http://www.vbaccelerator.com/home/Vb/Code/Libraries/Compression/Introduction_to_the_Info-ZIP_Libraries/article.asp" rel="nofollow">http://www.vbaccelerator.com/home/Vb/Code/Libraries/Compression/Introduction_to_the_Info-ZIP_Libraries/article.asp</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashok</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-319718</link>
		<dc:creator>Ashok</dc:creator>
		<pubDate>Mon, 07 Dec 2009 07:19:04 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-319718</guid>
		<description>How can I use your .dll from Visual Basic?
Can you provide me a VB sample.

Thanks.</description>
		<content:encoded><![CDATA[<p>How can I use your .dll from Visual Basic?<br />
Can you provide me a VB sample.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-317799</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Sat, 31 Oct 2009 21:41:08 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-317799</guid>
		<description>@Benson:

The wrapper just provides a convenient way to access zlib, helping with some initialization functions and the like. 

If you want to decompress a gzip file using zlib, I suggest you look at the program minigzip which accompanies the zlib distribution.

- Mark</description>
		<content:encoded><![CDATA[<p>@Benson:</p>
<p>The wrapper just provides a convenient way to access zlib, helping with some initialization functions and the like. </p>
<p>If you want to decompress a gzip file using zlib, I suggest you look at the program minigzip which accompanies the zlib distribution.</p>
<p>- Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: benson85</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-317765</link>
		<dc:creator>benson85</dc:creator>
		<pubDate>Sat, 31 Oct 2009 08:04:24 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-317765</guid>
		<description>Hi Mark

I am just wondering about the use of your ZlibEngine wrapper. What is the use of a wrapper and does it mean that data that are compressed using different wrappers such as zlib wrappers, gzip wrappers, or no wrappers at all can only be decompressed using programs with the same wrapper? How can I decompress a file with gzip headers using zlib? I am still new to C programming and still confused with the idea of wrappers.

Thanks for answering.

~Benson~</description>
		<content:encoded><![CDATA[<p>Hi Mark</p>
<p>I am just wondering about the use of your ZlibEngine wrapper. What is the use of a wrapper and does it mean that data that are compressed using different wrappers such as zlib wrappers, gzip wrappers, or no wrappers at all can only be decompressed using programs with the same wrapper? How can I decompress a file with gzip headers using zlib? I am still new to C programming and still confused with the idea of wrappers.</p>
<p>Thanks for answering.</p>
<p>~Benson~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-317508</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Wed, 28 Oct 2009 01:48:38 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-317508</guid>
		<description>@Stephen:

The only time I've used zlib with gzip format files, I have been successful with minigzip.c.

I would strongly suggest that you pose this as a question on comp.compression - you will almost certainly get a good answer, especially if you can point to a copy of the offending file.

- Mark</description>
		<content:encoded><![CDATA[<p>@Stephen:</p>
<p>The only time I've used zlib with gzip format files, I have been successful with minigzip.c.</p>
<p>I would strongly suggest that you pose this as a question on comp.compression - you will almost certainly get a good answer, especially if you can point to a copy of the offending file.</p>
<p>- Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Howe</title>
		<link>http://marknelson.us/1997/01/01/zlib-engine/#comment-317493</link>
		<dc:creator>Stephen Howe</dc:creator>
		<pubDate>Tue, 27 Oct 2009 21:36:44 +0000</pubDate>
		<guid>http://marknelson.us/1997/01/01/zlib-engine/#comment-317493</guid>
		<description>A further comment:

minigzip_d.exe that comes with ZLIB123-DLL.ZIP fails to unzip a GZIP file. Nothing occurs.

In contrast, GZIP.EXE succeeds. And on using -l -v to list details of the GZIP file, it reports that it is using the "deflat" method, the very method ZLIB claims to handle.

All very disappointing</description>
		<content:encoded><![CDATA[<p>A further comment:</p>
<p>minigzip_d.exe that comes with ZLIB123-DLL.ZIP fails to unzip a GZIP file. Nothing occurs.</p>
<p>In contrast, GZIP.EXE succeeds. And on using -l -v to list details of the GZIP file, it reports that it is using the "deflat" method, the very method ZLIB claims to handle.</p>
<p>All very disappointing</p>
]]></content:encoded>
	</item>
</channel>
</rss>
