problem in addin for the outlook

S

sathish.kulal

hi am working on addin for out look , and it was working fine in
office 11 ,
but in office 2007 , office (12) it is crashing , in the line "
HRESULT hr = pExplorer->get_CurrentFolder(&pMapiFolder); "


thanks and regrads sathish kulal

=============================================
my sample code is ...

if ( pOutlookApp != NULL ) {
m_pApp = pOutlookApp;
CComQIPtr<Outlook::_Explorer> pExplorer = GetExplorer() ;
if ( pExplorer != NULL ) {
// Outlook::MAPIFolder* pMapiFolder = NULL;
CComPtr<Outlook::MAPIFolder> pMapiFolder;
HRESULT hr = pExplorer->get_CurrentFolder(&pMapiFolder);
if ( pMapiFolder ) {
Outlook::OlItemType outlookItemType;
//Determine what type of folder they have switched to
pMapiFolder->get_DefaultItemType(&outlookItemType);
// If this is not a Mail Message folder, disable ADMC
functions
bool enableMenuItem = false;
if ( outlookItemType == Outlook::eek:lMailItem ) {
enableMenuItem = true;
}
EnableMenuItem( enableMenuItem );
}
}
}
===================================
 

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