Problems while adding new Category in Outlook 2007

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I got a problem in my outlook add-in developed by C++,
While adding new category, I’m trying to add a new Category so I can later
on assign it to my newly created appointment,

My Code as the following

Outlook::Categories *pCats = NULL;
Outlook::Category *pCat = NULL;
HRESULT hRes = E_FAIL;


if(m_pNameSpace != NULL)
{
// get list of categoreies
hRes = m_pNameSpace->get_Categories(&pCats);

if(hRes == S_OK && pCats != NULL)
{
hRes = pCats->Add(BSTR("my new Category"), Outlook::olCategoryColorBlue,
Outlook::olCategoryShortcutKeyNone , &pCat);
}
}
 
Sorry, i didn't write the rest of the problem
While pCats->Add been called, it throws an exception,
The exception error message is

“Run-Time Check Failure #0 - The value of ESP was not properly saved across
a function call. This is usually a result of calling a function declared
with one calling convention with a function pointer declared with a different
calling convention.â€

Could any body help
 
Back
Top