Visual C++ Examples

ChilkatHOMEAndroid™Classic ASPCC++C#C# WinRTDelphi ActiveXDelphi DLLVisual FoxProJavaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerShellPythonRubySQL ServerUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET WinRTVBScript

C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Email Object
Encryption
FTP
HTML Conversion
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...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Embedding a GIF Image into an XML Document

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries

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;
    }






 

 

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