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

 

 

 

 

 

 

 

 

Embedding a GIF Image into an XML Document

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

Source Code Listing

// Store a GIF image in an XML file.
void CreateGifXml(void)
    {
    // Our XML document.
    CkXml xml;
    xml.put_Tag("root");

    // Load a file.
    CkByteData byteData;
    byteData.loadFile("dudeCPP.gif");

    // Create a child XML node to hold the GIF image.
    CkXml *node = xml.NewChild("gif_image","");

    // Add the filename as an attribute.
    node->AddAttribute("filename","dudeCPP.gif");

    // Add the binary data. The data can be optionally Zip compressed
    // or AES encrypted here.
    node->SetBinaryContent(byteData.getData(),byteData.getSize(),false,false,0);

    // Save the XML.
    xml.SaveXml("GifImage.xml");

    // Access the binary data and save it to another GIF to 
    // prove that the data is preserved.
    CkByteData b;
    node->GetBinaryContent(b,false,false,0);
    b.saveFile("dudeOut.gif");

    delete node;

    return;
    }






 

 

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