function working on ol>2002 but no on ol2000

S

s3ven

Hi all,

I have problem with a function get_ItemProperties. It works on Outlook
2002 and 2003 but generate a debug ESP error ("value of esp was not
properly saved across a function call. This is usually a result of
calling a function with a function pointer declared in a different
calling convention.").

This is the code i used (i get a pointer on a the current select
contact item and try to get its properties)


CComPtr<IDispatch> _selecteditemDisp;
CComPtr<Outlook::_ContactItem> _selecteditem;
HRESULT hr;

hr = _pSelection->Item( CComVariant(1),
(IDispatch**)(&_selecteditemDisp));
if ((SUCCEEDED(hr)) && (_selecteditemDisp!=NULL))
{
hr=_selecteditemDisp->QueryInterface(_uuidof(Outlook::_ContactItem),
(void**)&_selecteditem);
if ((SUCCEEDED(hr)) && (_selecteditem!=NULL))
{
CComPtr<Outlook::ItemProperties> pIP;
_selecteditem->Display(); // this function works correctly in ol2k
pIP.p = NULL; // is it required?
hr =_selecteditem->get_ItemProperties(&pIP); // generate the ESP
error
// do something with pIP...
}
}

I import the corrects olb and dll file (mso9*) for ol2000 but ol2002 is
installed.


Many thanks in advance,
s3ven - http://s3ven.freesurf.fr
 
S

s3ven

A little correction:
"but ol2002 is installed. "

yes but only on the dev computer not on the computer where i test the
add in
 
D

Dmitry Streblechenko

Areou sure you are using Outlook 2000 headers? ItemProperties collection was
added in Outlook 2002.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

s3ven

Thanks Dmitry

I think that there was a problem in my import (error in the filename)
so my plugin was compiled without generating an error.

Now i fixed it and it show correctly all the incompatible functions and
properties when compiling.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top