Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

 

 

 

 

 

 

 

Zip a Directory Tree

Download Chilkat C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C++ Libraries for VC++ 6.0 / Win32

Very simple example showing how to Zip a directory tree.

// Visual C++ Example Source Code to create a Zip file
//

#include "stdafx.h"

#include "CkZip.h"
#include "CkZipEntry.h"

void testCreateZip(void)
{
    // Unlock the Zip product.
    // This only needs to be done once when the first CkZip object
    // is instantiated.  Any string automatically starts a fully-functional
    // 30-day trial.
    CkZip zip;
    bool success = zip.UnlockComponent("Anything for 30-day trial.");
    if (!success)
	{
	printf("%s\n",zip.lastErrorText());
	return;
	}

    // Create a new Zip and append files and directories recursively.
    zip.NewZip("myZip.zip");

    success = zip.AppendFiles("./Tree/*",true,0);
    if (!success)
	{
	printf("%s\n",zip.lastErrorText());
	return;
	}

    success = zip.WriteZipAndClose(0);
    if (!success)
	{
	printf("%s\n",zip.lastErrorText());
	return;
	}

    // Memory Leaks?  See CkSettings for more information about how
    // many C++ programmers mistakenly think there are memory leaks.

}

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    testCreateZip();
    return 0;

}

 

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser