(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 <CkMailMan.h>
#include <CkEmailBundle.h>
void ChilkatSample(void)
{
CkMailMan mailman;
// ...
// ...
const char *filePath = "c:/example/emailBundle.xml";
// ------------------------------------------------------------------------
// The LoadXmlFile method is deprecated:
CkEmailBundle *bundleObj = mailman.LoadXmlFile(filePath);
if (mailman.get_LastMethodSuccess() == false) {
std::cout << mailman.lastErrorText() << "\r\n";
return;
}
// ...
// ...
delete bundleObj;
// ------------------------------------------------------------------------
// Do the equivalent using EmailBundle.LoadXml.
CkEmailBundle bundle;
bool success = bundle.LoadXml(filePath);
if (success == false) {
std::cout << bundle.lastErrorText() << "\r\n";
return;
}
}
|