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:lMailItem ) {
enableMenuItem = true;
}
EnableMenuItem( enableMenuItem );
}
}
}
===================================
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:lMailItem ) {
enableMenuItem = true;
}
EnableMenuItem( enableMenuItem );
}
}
}
===================================