Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

MFC Rewrite Password Protected Zip (w/ Unicode CString)

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

Visual C++ 8.0 MFC Unicode example program using CString's demonstrating how to open an unencrypted .zip, set encryption params, and re-write it as a zip 2.0 encrypted (password-protected) zip.

	// Visual C++ MFC example program showing how
	// to open an unencrypted Zip, change the encryption properties
	// for password protection (Zip 2.0 encryption), and re-write.
	//
	// Also demonstrates how to use Unicode and CString with the
	// Chilkat C++ libs.
	CkString cks;
	CkZip zip;

	CString cs = _T("anything 30-day trial");
	wchar_t *w = cs.GetBuffer();
	cks.setStringU(w);
	zip.UnlockComponent(cks.getString());

	// Open a non-encrypted .zip
	cs = _T("exampleData.zip");
	cks.setStringU(cs.GetBuffer());
	zip.OpenZip(cks.getString());

	// Use (weak) Zip 2.0 encryption.
	zip.put_PasswordProtect(true);

	// Set the password...
	cs = _T("secret");
	cks.setStringU(cs.GetBuffer());
	zip.SetPassword(cks.getString());

	// Change the name of the .zip to be written.
	// If this is omitted, the exampleData.zip would be overwritten.
	cs = _T("pwdProtectedZip.zip");
	cks.setStringU(cs.GetBuffer());
	zip.put_FileName(cks.getString());

	// Write the zip.
	zip.WriteZipAndClose();
	zip.SaveLastError("writeZipLog.txt");

 

 

 

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

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

Mail Component · .NET Mail Component · XML Parser