Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
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

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

 

 

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-2008 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser