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 disapear from a CommanBar



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 28th 08, 04:22 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Minor, Thomas
external usenet poster
 
Posts: 5
Default Icons disapear from a CommanBar

Hi all,

I have a problem with an Outllok AddIn.

Our AddIn creates a CommandBar and adds some buttons to it.
Depending on the context of the user actions (ie which message type is
highlighted, is a contact highlighted..) some buttons
are enabled or disabled. This runs flawlessly on most of our customers
enviroments.
We now have one customer where the following problems occur:

On some or most buttons the icons are missing. The button is there and can
be used, but there is no icon.
We have a 'restore Toolbar' option in our settings dialog wich, under the
hood, removes all buttons from
the CommandBar and then adds them again. Interstingly, after each hit on the
restore-button, a different set of
Icons is displayed on the CommandBar until finally, after a non
deterministic count of tries, all icons are displayed.
This ist not quite the way we would like this to function.

The enviroment is Windows Server 2003, Terminal Server Mode, Citrix
Metaframe and Outlook 2000 SR3

Any hints are strongly appreciated...


--Thomas

  #2  
Old May 28th 08, 06:01 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Guest
 
Posts: n/a
Default Icons disapear from a CommanBar

Are they using Outlook 2000? You cannot load custom icons in add-ins for
that version, such as those loaded from a file or a resource file. You
need to use the CopyFace and PasteFace methods with built-in icons only.

--
Eric Legault [MVP - Outlook]
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, MOSS 2007
& WSS 3.0 Application Development)
Collaborative Innovations
- Try Picture Attachments Wizard For Microsoft Outlook -
Web: http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault


"Minor, Thomas" wrote in message
...
Hi all,

I have a problem with an Outllok AddIn.

Our AddIn creates a CommandBar and adds some buttons to it.
Depending on the context of the user actions (ie which message type is
highlighted, is a contact highlighted..) some buttons
are enabled or disabled. This runs flawlessly on most of our customers
enviroments.
We now have one customer where the following problems occur:

On some or most buttons the icons are missing. The button is there and can
be used, but there is no icon.
We have a 'restore Toolbar' option in our settings dialog wich, under the
hood, removes all buttons from
the CommandBar and then adds them again. Interstingly, after each hit on
the restore-button, a different set of
Icons is displayed on the CommandBar until finally, after a non
deterministic count of tries, all icons are displayed.
This ist not quite the way we would like this to function.

The enviroment is Windows Server 2003, Terminal Server Mode, Citrix
Metaframe and Outlook 2000 SR3

Any hints are strongly appreciated...


--Thomas


  #3  
Old May 28th 08, 08:13 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Icons disapear from a CommanBar

You can use any custom icon as long as it's a BMP with 16x16x256 colors in
Outlook 2000 buttons but you must use PasteFace after copying the image to
the clipboard. I regularly use BMPs stored in a resource file or in the file
system for Outlook 2000 button images.

--
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


wrote in message
...
Are they using Outlook 2000? You cannot load custom icons in add-ins for
that version, such as those loaded from a file or a resource file. You
need to use the CopyFace and PasteFace methods with built-in icons only.

--
Eric Legault [MVP - Outlook]
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, MOSS
2007 & WSS 3.0 Application Development)
Collaborative Innovations
- Try Picture Attachments Wizard For Microsoft Outlook -
Web: http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault


  #4  
Old May 29th 08, 10:01 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Minor, Thomas
external usenet poster
 
Posts: 5
Default Icons disapear from a CommanBar

Hi Eric.
Are they using Outlook 2000? You cannot load custom icons in add-ins for
that version, such as those loaded from a file or a resource file. You
need to use the CopyFace and PasteFace methods with built-in icons only.


That's right. I did not go into the detail here.

Outlook 2K connects to an Excahnge server.

We use the following code to put the icons on the toolbar:

void CAddin::InsertButtonFace(
_CommandBarButton *pCommandBarButton, UINT lIcon)
{
if (0 != lIcon)
{
if (OUTLOOK_XP = m_wOutlookVersion)
{
InsertButtonFacePicture(pCommandBarButton, lIcon);
}
else
{
// version less than OUTLOOK_XP - Outlook 2000
InsertButtonFaceClipboard(pCommandBarButton, lIcon);
}
}
}

Our Addin runs in different Outlook versions and m_wOutlookVersion keeps the
actual Outlook version after initialization.
Since we obviously act differnet on Outlook 2000 there might be a problem in
my function.

void CAddin::InsertButtonFaceClipboard(
_CommandBarButton *pCommandBarButton, UINT lIcon)
{
CopyIcon2Clipboard(lIcon);
try
{
pCommandBarButton-PasteFace();
}
catch (COleDispatchException *e)
{
if (e-m_scError == CdoE_CALL_FAILED)
{
e-Delete();
}
else
{
e-m_strDescription));
throw e;
}
}
// cleanup
OpenClipboard(NULL);
EmptyClipboard();
CloseClipboard();
}

Finally the copy2clipboard function.


#define ICON_SIZE_X 16
#define ICON_SIZE_Y 16

void CAddin::CopyIcon2Clipboard(UINT lIcon)
{
HICON hIcon;
ICONINFO iconInfo;
HDC hdc, hdcMem, hdcMemSrc;
HBITMAP hBitmap;
STGMEDIUM stgMedium;
COleDataSource *pClipboard;

hIcon = theApp.CRL_GetIcon(lIcon, CRL_ENABLED | CRL_SIZE_SMALL);

if (NULL == hIcon)
{
return;
}
VERIFY(GetIconInfo(hIcon, &iconInfo));

ASSERT(iconInfo.fIcon);
ASSERT(iconInfo.hbmColor);

// create transparency
hdc = ::GetDC(NULL);
ASSERT(hdc);
hBitmap = CreateCompatibleBitmap(hdc, ICON_SIZE_X, ICON_SIZE_Y);
VERIFY(DeleteDC(hdc));
hdc = NULL;
hdcMem = CreateCompatibleDC(NULL);
SelectObject(hdcMem, hBitmap);

// color with menu bg color
SelectObject(hdcMem, GetSysColorBrush(iColorMenu));
VERIFY(Rectangle(hdcMem, -1, -1, ICON_SIZE_X + 1, ICON_SIZE_Y + 1));

// aply mask
hdcMemSrc = CreateCompatibleDC(NULL);
ASSERT(hdcMemSrc);
SelectObject(hdcMemSrc, iconInfo.hbmMask);
VERIFY(BitBlt(hdcMem, 0, 0, ICON_SIZE_X, ICON_SIZE_Y, hdcMemSrc, 0, 0,
SRCAND));
SelectObject(hdcMemSrc, iconInfo.hbmColor);
VERIFY(BitBlt(hdcMem, 0, 0, ICON_SIZE_X, ICON_SIZE_Y, hdcMemSrc, 0, 0,
SRCINVERT));

// cleanup
VERIFY(DeleteDC(hdcMemSrc));
hdcMemSrc = NULL;
VERIFY(DeleteDC(hdcMem));
hdcMem = NULL;

stgMedium.pUnkForRelease = NULL;
stgMedium.hBitmap = hBitmap;
stgMedium.tymed = TYMED_GDI;

try
{
pClipboard = new COleDataSource();
ASSERT_VALID(pClipboard);
if (NULL == pClipboard)
{
DDERR(("kann kein Clipboard kriegen"));
}
else
{
pClipboard-CacheData(CF_BITMAP, &stgMedium);
pClipboard-SetClipboard();
}
}
catch (COleException *e)
{
CString str;

e-GetErrorMessage(str.GetBuffer(1024), 1024, NULL);
str.ReleaseBuffer();
e-Delete();
}
DestroyIcon(hIcon);
}



  #5  
Old May 28th 08, 08:15 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Icons disapear from a CommanBar

Impossible to tell from that. How are you creating the buttons, show some
sample code.

What sort of Explorer or Inspector is this on? Is WordMail involved?

What mode of operation is the user running for Outlook 2000, Internet only
mode or Corporate/workgroup mode?

--
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


"Minor, Thomas" wrote in message
...
Hi all,

I have a problem with an Outllok AddIn.

Our AddIn creates a CommandBar and adds some buttons to it.
Depending on the context of the user actions (ie which message type is
highlighted, is a contact highlighted..) some buttons
are enabled or disabled. This runs flawlessly on most of our customers
enviroments.
We now have one customer where the following problems occur:

On some or most buttons the icons are missing. The button is there and can
be used, but there is no icon.
We have a 'restore Toolbar' option in our settings dialog wich, under the
hood, removes all buttons from
the CommandBar and then adds them again. Interstingly, after each hit on
the restore-button, a different set of
Icons is displayed on the CommandBar until finally, after a non
deterministic count of tries, all icons are displayed.
This ist not quite the way we would like this to function.

The enviroment is Windows Server 2003, Terminal Server Mode, Citrix
Metaframe and Outlook 2000 SR3

Any hints are strongly appreciated...


--Thomas


  #6  
Old September 15th 08, 06:01 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Hichem S
external usenet poster
 
Posts: 13
Default Icons disapear from a CommanBar

I have the same problem only when WordMail is involved!
= a catatrophic failure message is displayed
(I am using Outlook 2003 and opening a new email item.)

Thanks



"Ken Slovak - [MVP - Outlook]" wrote:

Impossible to tell from that. How are you creating the buttons, show some
sample code.

What sort of Explorer or Inspector is this on? Is WordMail involved?

What mode of operation is the user running for Outlook 2000, Internet only
mode or Corporate/workgroup mode?

--
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


"Minor, Thomas" wrote in message
...
Hi all,

I have a problem with an Outllok AddIn.

Our AddIn creates a CommandBar and adds some buttons to it.
Depending on the context of the user actions (ie which message type is
highlighted, is a contact highlighted..) some buttons
are enabled or disabled. This runs flawlessly on most of our customers
enviroments.
We now have one customer where the following problems occur:

On some or most buttons the icons are missing. The button is there and can
be used, but there is no icon.
We have a 'restore Toolbar' option in our settings dialog wich, under the
hood, removes all buttons from
the CommandBar and then adds them again. Interstingly, after each hit on
the restore-button, a different set of
Icons is displayed on the CommandBar until finally, after a non
deterministic count of tries, all icons are displayed.
This ist not quite the way we would like this to function.

The enviroment is Windows Server 2003, Terminal Server Mode, Citrix
Metaframe and Outlook 2000 SR3

Any hints are strongly appreciated...


--Thomas



  #7  
Old September 15th 08, 06:34 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Icons disapear from a CommanBar

Please don't hijack other threads.

To repeat my answer to the other poster:

Impossible to tell from that.

How are you creating the buttons, and where are the buttons being created?
Show some sample code.

--
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


"Hichem S" wrote in message
...
I have the same problem only when WordMail is involved!
= a catatrophic failure message is displayed
(I am using Outlook 2003 and opening a new email item.)

Thanks


  #8  
Old September 15th 08, 07:24 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Hichem S
external usenet poster
 
Posts: 13
Default Icons disapear from a CommanBar

Sorry,
I posted a new thread with title : "Icons does not appear in a CommandBar :
Catastrophic failure throw"
Thank you.


"Ken Slovak - [MVP - Outlook]" wrote:

Please don't hijack other threads.

To repeat my answer to the other poster:

Impossible to tell from that.

How are you creating the buttons, and where are the buttons being created?
Show some sample code.

--
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


"Hichem S" wrote in message
...
I have the same problem only when WordMail is involved!
= a catatrophic failure message is displayed
(I am using Outlook 2003 and opening a new email item.)

Thanks



  #9  
Old October 16th 08, 03:16 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Minor, Thomas
external usenet poster
 
Posts: 5
Default Icons disapear from a CommanBar

Hi Ken,

it seems you did miss the fact that my problem was solved.
It was a timing problem and could be fixed with a ::Sleep().
I think it is related to multi-core, multi-processor issues.

Thanks for the help.

--
Thomas Minor
--


"Ken Slovak - [MVP - Outlook]" schrieb im Newsbeitrag
...
Please don't hijack other threads.

To repeat my answer to the other poster:

Impossible to tell from that.

How are you creating the buttons, and where are the buttons being created?
Show some sample code.

--
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


"Hichem S" wrote in message
...
I have the same problem only when WordMail is involved!
= a catatrophic failure message is displayed
(I am using Outlook 2003 and opening a new email item.)

Thanks



  #10  
Old May 29th 08, 10:39 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.office.developer.com.add_ins,microsoft.public.outlook.program_addins
Jialiang Ge [MSFT]
external usenet poster
 
Posts: 4
Default Icons disapear from a CommanBar

Good morning, Thomas. Welcome to office.developer.com.add_ins newsgroup! My
name is Jialiang Ge [MSFT].



I once handled a very similar issue, where a customer said his
CommandBarButton icon cannot be shown only in Outlook 2000. That problem
turned out to be caused by the code:

HBITMAP hSrcBmp = LoadBitmap(AfxGetResourceHandle(),

MAKEINTRESOURCE(IDB_BITMAP1));

The method LoadBitmap has been superseded by the LoadImage function because
it is incompatible with some device context. Thus, the resolution was to
replace the line with:

HBITMAP hSrcBmp = (HBITMAP)::LoadImage(GetModuleHandle(NULL),

MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION);



Thomas, because you did not mention how you loaded the bitmap icon or
provided any code snippet for test, I cannot quickly figure out the reason
for this specific issue. But I suggest you read the above-mentioned thread:

http://office-outlook.com/outlook-fo...60/#msg_209360



And if the thread does not help, would you please show us some code
snippets? I'd be very happy to test it for you.



Regards,

Jialiang Ge , remove 'online.')

Microsoft Online Community Support



Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
.



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support

Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support

professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations

that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



"Minor, Thomas" wrote in message
...
Hi all,

I have a problem with an Outllok AddIn.

Our AddIn creates a CommandBar and adds some buttons to it.
Depending on the context of the user actions (ie which message type is
highlighted, is a contact highlighted..) some buttons
are enabled or disabled. This runs flawlessly on most of our customers
enviroments.
We now have one customer where the following problems occur:

On some or most buttons the icons are missing. The button is there and can
be used, but there is no icon.
We have a 'restore Toolbar' option in our settings dialog wich, under the
hood, removes all buttons from
the CommandBar and then adds them again. Interstingly, after each hit on
the restore-button, a different set of
Icons is displayed on the CommandBar until finally, after a non
deterministic count of tries, all icons are displayed.
This ist not quite the way we would like this to function.

The enviroment is Windows Server 2003, Terminal Server Mode, Citrix
Metaframe and Outlook 2000 SR3

Any hints are strongly appreciated...


--Thomas



 




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
Folders Disapear ???? Chip and Roxanne Outlook Express 5 March 8th 08 06:56 PM
Saving commanbar position in shared add-in ian Add-ins for Outlook 1 September 1st 06 07:10 PM
All of my new appointments disapear in Outlook 2007 Beta2 MWDoty Outlook - Calandaring 7 June 23rd 06 02:19 PM
Large Icons/Icons Disappearing Barattolo_67 Outlook Express 5 March 6th 06 02:43 AM
Re-occurring appointments disapear. sby Outlook - Calandaring 0 February 6th 06 02:30 PM


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