(Unicode C++) Transition from MailMan.LoadXmlFile to EmailBundle.LoadXml
Provides instructions for replacing deprecated LoadXmlFile method calls with EmailBundle.LoadXml. Note: This example requires Chilkat v11.0.0 or greater.
#include <CkMailManW.h>
#include <CkEmailBundleW.h>
void ChilkatSample(void)
{
CkMailManW mailman;
// ...
// ...
const wchar_t *filePath = L"c:/example/emailBundle.xml";
// ------------------------------------------------------------------------
// The LoadXmlFile method is deprecated:
CkEmailBundleW *bundleObj = mailman.LoadXmlFile(filePath);
if (mailman.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",mailman.lastErrorText());
return;
}
// ...
// ...
delete bundleObj;
// ------------------------------------------------------------------------
// Do the equivalent using EmailBundle.LoadXml.
CkEmailBundleW bundle;
bool success = bundle.LoadXml(filePath);
if (success == false) {
wprintf(L"%s\n",bundle.lastErrorText());
return;
}
}
|