![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
This one really puzzles me.
I'm developing an Outlook COM Add-in, C++/ATL, which is to work under Outlook 2k - 2k7. I've simplified the code and isolated the problem in a default VS2005 Extensibility project, of which below you can find the code from the OnConnection method. The project compiles fine and shows no issues under Outlook 2007. Also in Outlook 2000, everything works fine until Close is pressed. Then it faults with 'exception at 0x030f0db6 in OUTLOOK.EXE: 0xC000001D: Illegal Instruction.' It only faults if I press buttons on the toolbar (e.g. Calendar, Contacts) before exiting. The problem seems to involve use of the ActiveMenubar - if I add a new CommandBar and add the ControlPopup to that, the problem does not occur. Who can help? Sincere regards, Georg-Hendrik Attachement 1: OnConnection Method (in standard VS2005 Extensibility project) STDMETHODIMP CConnect::OnConnection(...) { // Default code pApplication-QueryInterface(__uuidof(IDispatch), (LPVOID*)&m_pApplication); pAddInInst-QueryInterface(__uuidof(IDispatch), (LPVOID*)&m_pAddInInstance); // Isolated problem code starts here ::MessageBox(NULL, _T("Connection"), NULL, 0); CComQIPtrOutlook::_Application soOutlook; CComPtrOutlook::_Explorer soExplorer; CComPtrOffice::_CommandBars soBars; CComPtrOffice::CommandBar soActiveMenu; CComPtrOffice::CommandBarControls soMenuItems; CComPtrOffice::CommandBarControl soMyMenuItem; try { // Get to the active Outlook menu bar controls... soOutlook = pApplication; soExplorer = soOutlook-ActiveExplorer(); soBars = soExplorer-GetCommandBars(); soActiveMenu = soBars-ActiveMenuBar; soMenuItems = soActiveMenu-GetControls(); // ... and add an empty pop-up menu. soMyMenuItem = soMenuItems-Add(msoControlPopup, vtMissing, vtMissing, vtMissing, VARIANT_TRUE); soMyMenuItem-Caption = _T("MyMenuItem"); soMyMenuItem-Tag = _T("my.menuitem"); } catch (...) { ::MessageBox(NULL, _T("BFE"), NULL, 0); } // The error shows regardless of the following // few lines of code; Setting the CComPtr s to // NULL did work for five minutes (literally...) soMyMenuItem = NULL; soMenuItems = NULL; soActiveMenu = NULL; soBars = NULL; soExplorer = NULL; return S_OK; } |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding seperator to Outlook standard menu | John | Add-ins for Outlook | 2 | August 29th 07 02:40 PM |
Outlook add-in - adding to the Appointments Insert menu | Scott Lyon | Outlook - Using Forms | 3 | October 9th 06 09:29 PM |
Novice: Adding a menu to current menu? | Peter | Add-ins for Outlook | 4 | October 2nd 06 03:34 PM |
adding a context menu in Outlook | donald | Add-ins for Outlook | 6 | May 3rd 06 01:49 PM |
Adding Outlook Express to my start menu | MP Boettger | Outlook - General Queries | 1 | February 22nd 06 05:45 PM |