Young Developer
2007-06-26 17:25:00 UTC
Hi All!
The code below works fine under Exchange 2000 and 2003 but not under 2007.
I want to check event record property "urn:schemas:mailheader:content-class"
in OnSyncSave. The code below works only for one type of e-mail: MIME with
HTML under Exchange 2007 but doesn't work for MIME text-only e-mail and plain
UUENCODE text e-mail. For the two others I aways catch com_error: ERROR
CONTENTCLASS = Unknown error 0x800A0E98
I remind You that this code worked for all types of e-mails under Exchange
2000/2003
Implementation:
STDMETHODIMP CTest::OnSyncSave(IExStoreEventInfo * pEventInfo, BSTR
bstrURLItem, long lFlags)
{
HRESULT hr = S_OK;
if (lFlags & (EVT_IS_COLLECTION | EVT_INVALID_SOURCE_URL | EVT_INVALID_URL
| EVT_ERROR))
return hr;
if (lFlags & EVT_SYNC_BEGIN)
{
IExStoreDispEventInfoPtr pDispInfo = pEventInfo;
_RecordPtr rec;
hr = pDispInfo->get_EventRecord((IDispatch**)&rec);
if(SUCCEEDED(hr))
{
_bstr_t strContentClass = "";
try
{
strContentClass =
rec->Fields->GetItem(_T("urn:schemas:mailheader:content-class"))->Value.bstrVal;
}
catch(_com_error &e)
{
#ifdef _DEBUGPRINT
debugprn(_T("ERROR CONTENTCLASS = "));
debugprn((TCHAR*)e.ErrorMessage());
#endif
}
}
}
return hr;
}
The code below works fine under Exchange 2000 and 2003 but not under 2007.
I want to check event record property "urn:schemas:mailheader:content-class"
in OnSyncSave. The code below works only for one type of e-mail: MIME with
HTML under Exchange 2007 but doesn't work for MIME text-only e-mail and plain
UUENCODE text e-mail. For the two others I aways catch com_error: ERROR
CONTENTCLASS = Unknown error 0x800A0E98
I remind You that this code worked for all types of e-mails under Exchange
2000/2003
Implementation:
STDMETHODIMP CTest::OnSyncSave(IExStoreEventInfo * pEventInfo, BSTR
bstrURLItem, long lFlags)
{
HRESULT hr = S_OK;
if (lFlags & (EVT_IS_COLLECTION | EVT_INVALID_SOURCE_URL | EVT_INVALID_URL
| EVT_ERROR))
return hr;
if (lFlags & EVT_SYNC_BEGIN)
{
IExStoreDispEventInfoPtr pDispInfo = pEventInfo;
_RecordPtr rec;
hr = pDispInfo->get_EventRecord((IDispatch**)&rec);
if(SUCCEEDED(hr))
{
_bstr_t strContentClass = "";
try
{
strContentClass =
rec->Fields->GetItem(_T("urn:schemas:mailheader:content-class"))->Value.bstrVal;
}
catch(_com_error &e)
{
#ifdef _DEBUGPRINT
debugprn(_T("ERROR CONTENTCLASS = "));
debugprn((TCHAR*)e.ErrorMessage());
#endif
}
}
}
return hr;
}