S
Sven Ilius
Hallo,
i try to write a new hidden item with redemption. But i get only an
empty new item, there are no propertys filled.
As you can see in my testcode. The first time the code runs, i create
a hidden-item. if i run the code again, i check the hidden items and
find also my item, but this has empty propertys.
any ideas ?
Sorry for my english
Sven Ilius
CComPtr<Redemption::ISafeMAPIFolder> sFldr;
CLSID clsid;
HRESULT hr;
if ((hr = ::CLSIDFromProgID(L"MySafeDll.MyMAPIFolder",
&clsid)) != NOERROR)
{
ATLTRACE("\nFailed get ISafeMAPIFolder from Redemption");
}
if ((hr = ::CoCreateInstance(clsid, NULL,
CLSCTX_INPROC_SERVER, __uuidof(ISafeMAPIFolder), (void**)
&sFldr)) != S_OK)
{
ATLTRACE("\nFailed get ISafeMAPIFolder from Redemption");
}
else
{
CComPtr<Outlook::MAPIFolder> fldr;
if( ns->GetDefaultFolder(olFolderInbox,&fldr)==S_OK);
{
hr = sFldr->put_Item(fldr);
CComPtr<Redemption::ISafeItems> hiddenitems;
sFldr->get_HiddenItems(&hiddenitems);
CComPtr<Redemption::IMessageItem> hmessage;
long count;
hiddenitems->get_Count(&count);
BSTR subj,body;
for(long i=0;i<count;i++)
{
hiddenitems->Item(CComVariant(i),&hmessage);
BSTR messclass;
hmessage->get_MessageClass(&messclass);
if(hmessage->get_Subject(&subj)==S_OK)
{
if(subj == NULL)
{
// if it goes to this, the Sybject -
property is empty, but i have written it, below
hmessage->Delete();
}
else
SysFreeString(subj);
}
hmessage = NULL;
}
hr =hiddenitems->get_Count(&count);
hr =hiddenitems->Add(CComVariant(L"IPM.Note"),&hmessage);
hr =hmessage->put_Subject(L"TEST");
hr =hmessage->Save();
hmessage = NULL;
hiddenitems = NULL;
}
fldr = NULL;
}
sFldr = NULL;
i try to write a new hidden item with redemption. But i get only an
empty new item, there are no propertys filled.
As you can see in my testcode. The first time the code runs, i create
a hidden-item. if i run the code again, i check the hidden items and
find also my item, but this has empty propertys.
any ideas ?
Sorry for my english
Sven Ilius
CComPtr<Redemption::ISafeMAPIFolder> sFldr;
CLSID clsid;
HRESULT hr;
if ((hr = ::CLSIDFromProgID(L"MySafeDll.MyMAPIFolder",
&clsid)) != NOERROR)
{
ATLTRACE("\nFailed get ISafeMAPIFolder from Redemption");
}
if ((hr = ::CoCreateInstance(clsid, NULL,
CLSCTX_INPROC_SERVER, __uuidof(ISafeMAPIFolder), (void**)
&sFldr)) != S_OK)
{
ATLTRACE("\nFailed get ISafeMAPIFolder from Redemption");
}
else
{
CComPtr<Outlook::MAPIFolder> fldr;
if( ns->GetDefaultFolder(olFolderInbox,&fldr)==S_OK);
{
hr = sFldr->put_Item(fldr);
CComPtr<Redemption::ISafeItems> hiddenitems;
sFldr->get_HiddenItems(&hiddenitems);
CComPtr<Redemption::IMessageItem> hmessage;
long count;
hiddenitems->get_Count(&count);
BSTR subj,body;
for(long i=0;i<count;i++)
{
hiddenitems->Item(CComVariant(i),&hmessage);
BSTR messclass;
hmessage->get_MessageClass(&messclass);
if(hmessage->get_Subject(&subj)==S_OK)
{
if(subj == NULL)
{
// if it goes to this, the Sybject -
property is empty, but i have written it, below
hmessage->Delete();
}
else
SysFreeString(subj);
}
hmessage = NULL;
}
hr =hiddenitems->get_Count(&count);
hr =hiddenitems->Add(CComVariant(L"IPM.Note"),&hmessage);
hr =hmessage->put_Subject(L"TEST");
hr =hmessage->Save();
hmessage = NULL;
hiddenitems = NULL;
}
fldr = NULL;
}
sFldr = NULL;