Print Page | Close Window

Problems with CXTToolBar::LoadBitmap()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=200
Printed Date: 20 May 2024 at 11:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems with CXTToolBar::LoadBitmap()
Posted By: Jonas
Subject: Problems with CXTToolBar::LoadBitmap()
Date Posted: 29 October 2003 at 3:40am

My intention is to create dynamic toolbars at run-time. However, the CXTToolBar::LoadBitmap() doesn't seem to work (i.e the button images does not show up). I tried the same code with MFC's CToolBar and that works perfectly.

Here is a snippet from my code:

 static UINT BASED_CODE TB_IDS[] =
 {
  34500,     // ID_BUTTON1
  34501,     // ID_BUTTON2
  ID_SEPARATOR,
  34502,
  34503
 };

DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC;

m_wndDynToolBar.CreateEx(this, TBSTYLE_FLAT, dwStyle, CRect(0, 0, 0, 0), 59500)m_wndDynToolBar.LoadBitmap(IDB_TB);
m_wndDynToolBar.SetButtons(TB_IDS, sizeof(TB_IDS) / sizeof(UINT));
m_wndDynToolBar.SetWindowText(_T("Dynamic toolbar"));

----------

IDB_TB is a 64x15 16 color bitmap. m_wndDynToolBar is a CXTToolBar instance.

Update: The bitmap images show up if xtAfxData.bXPMode is set to FALSE. Not otherwise.

Regards,

Jonas E




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net