Sample code for 30+ languages & platforms
Unicode C

Transition from MailMan.LoadXmlString to EmailBundle.LoadXmlString

Provides instructions for replacing deprecated LoadXmlString method calls with EmailBundle.LoadXmlString.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkMailManW.h>
#include <C_CkEmailBundleW.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkMailManW mailman;
    const wchar_t *xmlBundleStr;
    HCkEmailBundleW bundleObj;
    HCkEmailBundleW bundle;

    success = FALSE;

    mailman = CkMailManW_Create();

    //  ...
    //  ...

    xmlBundleStr = L"...";

    //  ------------------------------------------------------------------------
    //  The LoadXmlString method is deprecated:

    bundleObj = CkMailManW_LoadXmlString(mailman,xmlBundleStr);
    if (CkMailManW_getLastMethodSuccess(mailman) == FALSE) {
        wprintf(L"%s\n",CkMailManW_lastErrorText(mailman));
        CkMailManW_Dispose(mailman);
        return;
    }

    //  ...
    //  ...

    CkEmailBundleW_Dispose(bundleObj);

    //  ------------------------------------------------------------------------
    //  Do the equivalent using EmailBundle.LoadXmlString.

    bundle = CkEmailBundleW_Create();
    success = CkEmailBundleW_LoadXmlString(bundle,xmlBundleStr);
    if (success == FALSE) {
        wprintf(L"%s\n",CkEmailBundleW_lastErrorText(bundle));
        CkMailManW_Dispose(mailman);
        CkEmailBundleW_Dispose(bundle);
        return;
    }



    CkMailManW_Dispose(mailman);
    CkEmailBundleW_Dispose(bundle);

    }