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

Icons does not appear in a CommandBar : Catastrophic failure throw



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old September 15th 08, 07:21 PM posted to microsoft.public.outlook.program_addins
Hichem S
external usenet poster
 
Posts: 13
Default Icons does not appear in a CommandBar : Catastrophic failure throw

I am using outlook 2003. When creating a new mail with WordEditor enabled, an
exception is thrown. I tried to debug and the exception gets thrown (see
code below) when I try to set the picture/mask property of a button.
My buttons are created by my outlook add-in with my word add-in disabled.
If I disable the outlook add-in and enable the word one, the buttons
creation is successful.
Thank you for your help...

Here is how I create my menubar and button :

CommandBar menuBar = context.GetCommandBars().ActiveMenuBar;

int controlCount = menuBar.Controls.Count;
// Add the menu two positions before the last one which is
"Help" (before Help and Windows menus).
CommandBarPopup rootMenu = (CommandBarPopup) menuBar.Controls.Add(
MsoControlType.msoControlPopup, Missing.Value,
Missing.Value, controlCount - 1, true);
if (rootMenu == null)
{
return null;
}
rootMenu.Caption = "ProductNameMenu";
rootMenu.Tag = NAME_MENU_BAR;
rootMenu.DescriptionText = "ProductName";
rootMenu.OLEUsage = MsoControlOLEUsage.msoControlOLEUsageClient;
rootMenu.TooltipText = "ProductName";
rootMenu.Visible = true;
rootMenu.Enabled = true;
return AddMenuButtons(context, rootMenu);



CommandBarButton myButton = (CommandBarButton)
rootMenu.Controls.Add(MsoControlType.msoControlBut ton, Missing.Value,
Missing.Value, Missing.Value, true);
myButton .Caption = "Caption";
myButton .Style = MsoButtonStyle.msoButtonAutomatic;
myButton .TooltipText = context.GetButtonSuperTip();
myButton .DescriptionText = context.GetButtonSuperTip();
myButton .OLEUsage = MsoControlOLEUsage.msoControlOLEUsageClient;
myButton .Picture = AxHelper.GetIPictureDispFromImage(BitmapAddDocumen t);
myButton .Mask = AxHelper.GetIPictureDispFromImage(BitmapAddDocumen tMask);
myButton .Visible = true;
myButton .Enabled = true;


// This the class that helps to implement GetIPictureDispFromImage

public class AxHelper : AxHost
{
private AxHelper()
: base(null){}

public static IPictureDisp GetIPictureDispFromImage(Image image)
{
return (IPictureDisp)GetIPictureDispFromPicture(image);
}


public new static IPicture GetIPictureFromPicture(Image image)
{
return GetIPictureFromPicture(image);
}
}
 




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
Recover Mail? - Catastrophic HD failure kimdnw Outlook - Installation 2 December 5th 07 10:56 PM
Catastrophic Failure Mark Add-ins for Outlook 7 September 19th 07 06:36 PM
Error Message: Managed MAPI Service Catastrophic Failure BearlyCat Outlook - General Queries 0 November 27th 06 06:02 PM
Outlook 2007 Beta Catastrophic Failure Tibelian Outlook - General Queries 19 August 4th 06 01:28 AM
Catastrophic Failure while accessing Redemption.SafeMailItem.To and Recipients jisha Outlook and VBA 1 June 30th 06 05:48 PM


All times are GMT +1. The time now is 12:42 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.