A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

ActiveExplorer return NULL on new Window user login and running Outlook first time



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 9th 10, 02:43 AM posted to microsoft.public.outlook.program_addins
Shawn[_3_]
external usenet poster
 
Posts: 11
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

Back on working with this issue. I finally got a COM addin working. Outlook 2007 and 2010 is working now. I have our toolbar in Outlook in both version, but it currently cannot do anything since I have not been able to figure out exactly how to get the MAPI session so that I can see what account I'm on.

I do get the notification when the user click on the folder, since that is all we care about using the SINK that I have provided below:


SINK_ENTRY_INFO(1,__uuidof(Outlook::ExplorerEvents ),/*dispinterface*/0xf002,OnFolderChange,&OnSimpleEventInfo);


How do I go about getting the Extended MAPI on that folder? If I do the following:


BSTR EntryID;
CComPtrOutlook::MAPIFolder MapiFolder;

m_spExplorer-get_CurrentFolder(&MapiFolder);
MapiFolder-get_EntryID(&EntryID);


Once I get the "EntryID", how do I go about opening the message store (IMsgStore/LPMDB) since I need to know what message store we are dealing with..
Submitted using http://www.outlookforums.com
Ads
  #2  
Old May 10th 10, 03:58 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

You really need to preserve parts of preceding messages in the thread, it
makes it very hard to figure out what you're talking about when you snip
things like that.

Once you have an EntryID you need to use that to get the folder using the
NameSpace.GetFolderFromID() method.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Shawn" swalker[at]bynari[dot]net wrote in message
...
Back on working with this issue. I finally got a COM addin working.
Outlook 2007 and 2010 is working now. I have our toolbar in Outlook in
both version, but it currently cannot do anything since I have not been
able to figure out exactly how to get the MAPI session so that I can see
what account I'm on.

I do get the notification when the user click on the folder, since that is
all we care about using the SINK that I have provided below:


SINK_ENTRY_INFO(1,__uuidof(Outlook::ExplorerEvents ),/*dispinterface*/0xf002,OnFolderChange,&OnSimpleEventInfo);


How do I go about getting the Extended MAPI on that folder? If I do the
following:


BSTR EntryID;
CComPtrOutlook::MAPIFolder MapiFolder;

m_spExplorer-get_CurrentFolder(&MapiFolder);
MapiFolder-get_EntryID(&EntryID);


Once I get the "EntryID", how do I go about opening the message store
(IMsgStore/LPMDB) since I need to know what message store we are dealing
with.. Submitted using http://www.outlookforums.com


  #3  
Old May 10th 10, 06:43 PM posted to microsoft.public.outlook.program_addins
Shawn[_3_]
external usenet poster
 
Posts: 11
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

Thanks. Now I have another problem with Outlook 2007. Whenever I click on the toolbar button, I'm getting two invokes into my "CButtonHandler::Invoke" method. I do not get that in 2003 and 2010.

But what is strange is that I do not get two callback when I click on the menu item in the drop down menu. Just the toolbar.

Is there something else that I need to handle that issue for 2007?

kenslovak wrote on Mon, 10 May 2010 09:58
You really need to preserve parts of preceding messages in the thread, it
makes it very hard to figure out what you're talking about when you snip
things like that.

Once you have an EntryID you need to use that to get the folder using the
NameSpace.GetFolderFromID() method.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Shawn" swalker[at]bynari[dot]net wrote in message
...
Back on working with this issue. I finally got a COM addin working.
Outlook 2007 and 2010 is working now. I have our toolbar in Outlook in
both version, but it currently cannot do anything since I have not been
able to figure out exactly how to get the MAPI session so that I can see
what account I'm on.

I do get the notification when the user click on the folder, since that is
all we care about using the SINK that I have provided below:


SINK_ENTRY_INFO(1,__uuidof(Outlook::ExplorerEvents ),/*dispin terface*/0xf002,OnFolderChange,&OnSimpleEventInfo);


How do I go about getting the Extended MAPI on that folder? If I do the
following:


BSTR EntryID;
CComPtrOutlook::MAPIFolder MapiFolder;

m_spExplorer-get_CurrentFolder(&MapiFolder);
MapiFolder-get_EntryID(&EntryID);


Once I get the "EntryID", how do I go about opening the message store
(IMsgStore/LPMDB) since I need to know what message store we are dealing
with.. Submitted using http://www.outlookforums.com


  #4  
Old May 10th 10, 07:08 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

There is no difference in handling a
toolbar/menu/CommandBar/CommandBarPopup/etc. in Outlook 2007, 2003, or any
other version that supports that interface.

Usually if you get 2 click events firing for one click it means that the
buttons you created use the same Tag property. Every Tag should be unique.
If more than one button has the same Tag you will get one click event per
button using that Tag.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Shawn" swalker[at]bynari[dot]net wrote in message
...
Thanks. Now I have another problem with Outlook 2007. Whenever I click
on the toolbar button, I'm getting two invokes into my
"CButtonHandler::Invoke" method. I do not get that in 2003 and 2010.

But what is strange is that I do not get two callback when I click on the
menu item in the drop down menu. Just the toolbar.

Is there something else that I need to handle that issue for 2007?


  #5  
Old May 10th 10, 07:53 PM posted to microsoft.public.outlook.program_addins
Shawn[_3_]
external usenet poster
 
Posts: 11
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

Are you talking about the CommandBarControl.put_Tag? If so, all of the strings is unique.

kenslovak wrote on Mon, 10 May 2010 13:08
There is no difference in handling a
toolbar/menu/CommandBar/CommandBarPopup/etc. in Outlook 2007, 2003, or any
other version that supports that interface.

Usually if you get 2 click events firing for one click it means that the
buttons you created use the same Tag property. Every Tag should be unique.
If more than one button has the same Tag you will get one click event per
button using that Tag.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Shawn" swalker[at]bynari[dot]net wrote in message
...
Thanks. Now I have another problem with Outlook 2007. Whenever I click
on the toolbar button, I'm getting two invokes into my
"CButtonHandler::Invoke" method. I do not get that in 2003 and 2010.

But what is strange is that I do not get two callback when I click on the
menu item in the drop down menu. Just the toolbar.

Is there something else that I need to handle that issue for 2007?


  #6  
Old May 10th 10, 08:58 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

I don't like using a pure guid for that. I often have to maintain state on
things such as toggle buttons on a per Inspector basis. What I do is
maintain a key property (int) that I use as an index into wrapper
collections for Inspectors and Explorers. Each wrapper class stores the key
value for that instance, which is a unique number during that Outlook
session. Then I take the key value and add that as a string to a unique tag
string or guid. That way I can always tell what specific button or
Inspector/Explorer a tag belongs to.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Shawn" swalker[at]bynari[dot]net wrote in message
...
I resolved this issue. I changed the code to do:


CommandBarControl.put_Tag(Guid.NewGuid().ToString( ));


I did that to all of the CommandBarControl and the double invoke stopped.
Not sure which one I was missing or had the same strings. But, using the
GUID string will make it easier to not forget or have the same string.


  #7  
Old May 10th 10, 09:26 PM posted to microsoft.public.outlook.program_addins
Shawn[_3_]
external usenet poster
 
Posts: 11
Default ActiveExplorer return NULL on new Window user login and running Outlook first time

I can see that if we need to keep some sort of state for the button/menu items. But, we don't have any state that we need to keep track for our buttons. So, for now this will do.

kenslovak wrote on Mon, 10 May 2010 14:58
I don't like using a pure guid for that. I often have to maintain state on
things such as toggle buttons on a per Inspector basis. What I do is
maintain a key property (int) that I use as an index into wrapper
collections for Inspectors and Explorers. Each wrapper class stores the key
value for that instance, which is a unique number during that Outlook
session. Then I take the key value and add that as a string to a unique tag
string or guid. That way I can always tell what specific button or
Inspector/Explorer a tag belongs to.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Shawn" swalker[at]bynari[dot]net wrote in message
...
I resolved this issue. I changed the code to do:


CommandBarControl.put_Tag(Guid.NewGuid().ToString( ));


I did that to all of the CommandBarControl and the double invoke stopped.
Not sure which one I was missing or had the same strings. But, using the
GUID string will make it easier to not forget or have the same string.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveExplorer return NULL on new Window user login and running Outlook first time Shawn[_3_] Add-ins for Outlook 9 April 23rd 10 06:18 PM
Outlook throws up login window when pop3 login fails. How to stop thatbehavior? Outlook Guy[_2_] Outlook - General Queries 2 June 11th 09 04:14 PM
Outlook within Excel, get return code to know if user pressed SEND gary Outlook and VBA 3 July 20th 07 08:56 PM
Setting a date/time field to 'NULL' dch3 Outlook - Using Forms 1 November 16th 06 09:43 PM
Modify Outlook Login window Nphil Outlook - Installation 1 April 8th 06 03:12 PM


All times are GMT +1. The time now is 12:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.