Unicode C
Unicode C
Transition from MailMan.LoadXmlFile to EmailBundle.LoadXml
Provides instructions for replacing deprecated LoadXmlFile method calls with EmailBundle.LoadXml.Chilkat Unicode C Downloads
#include <C_CkMailManW.h>
#include <C_CkEmailBundleW.h>
void ChilkatSample(void)
{
BOOL success;
HCkMailManW mailman;
const wchar_t *filePath;
HCkEmailBundleW bundleObj;
HCkEmailBundleW bundle;
success = FALSE;
mailman = CkMailManW_Create();
// ...
// ...
filePath = L"c:/example/emailBundle.xml";
// ------------------------------------------------------------------------
// The LoadXmlFile method is deprecated:
bundleObj = CkMailManW_LoadXmlFile(mailman,filePath);
if (CkMailManW_getLastMethodSuccess(mailman) == FALSE) {
wprintf(L"%s\n",CkMailManW_lastErrorText(mailman));
CkMailManW_Dispose(mailman);
return;
}
// ...
// ...
CkEmailBundleW_Dispose(bundleObj);
// ------------------------------------------------------------------------
// Do the equivalent using EmailBundle.LoadXml.
bundle = CkEmailBundleW_Create();
success = CkEmailBundleW_LoadXml(bundle,filePath);
if (success == FALSE) {
wprintf(L"%s\n",CkEmailBundleW_lastErrorText(bundle));
CkMailManW_Dispose(mailman);
CkEmailBundleW_Dispose(bundle);
return;
}
CkMailManW_Dispose(mailman);
CkEmailBundleW_Dispose(bundle);
}