Discussion:
get_EventRecord Exchange 2007 broken functionality
(too old to reply)
Young Developer
2007-06-26 17:25:00 UTC
Permalink
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;
}
Dgoldman [MSFT]
2007-08-02 01:06:56 UTC
Permalink
The error that you are getting is the following:
adErrUnavailable -3736 -2146824552 - 0x800A0E98 Operation failed to
complete and the status is unavailable. The field may be unavailable or the
operation was not attempted.

Have you compiled your code and actually stepped through it with WinDBG to
see what the problem is. For what ever reason it looks like when it queries
for that property it is not finding it. I know with Exchange 2007 we use
property sets so this might be part of the problem.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Dgoldman
http://blogs.msdn.com/dgoldman
Download OABInteg
(http://gotdotnet.com/Community/UserSamples/Download.aspx?SampleGuid=A2338E73-F521-4071-9B1D-AAF49C346ACD)
Post by Young Developer
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
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;
}
Loading...