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