I have created a new empty dialog to test the code Some notes on CMFCToolBar – Docking Large Buttons and use of the MDIClientArea but I see that this line produces false
:
bool b = m_FirstToolbar.LoadToolBarEx(IDR_MAINFRAME, tbi, TRUE);
and this is the resources of my project:
what's the problem and what should I add to the resources?
please help me. this is the third question that I ask today about toolbars on an MFC dialog based application.
My toolbar on a dialog based mfc application is not shown
after writing the code to add a toolbar to a dialog-based mfc the dialog doesn't run
and I have read many questions on this site and also studied lots of pages on the web. finally I came to the point to use CMFCToolBar
class instead of CToolbar
to support 32bit 24x24 icons for the toolbar but none of the pages helped really and I haven't still seen the toolbar at top of my dialog.
Could you please help me introduce a link,a video tutorial and etc which has taught adding toolbars that support icons of 32bit images in Visual studio 2010 to a dialog-based mfc application **
**I'd prefer a tutorial which has started from scratch and is good for a beginner of MFC as well a to aguru
thanks.I'd be glad to here your answers.
Edited section of my question based on @Edward Clements useful guidances
this is my project's Resource.h file
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by InitialJobProject2.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_INITIALJOBPROJECT2_DIALOG 102
#define IDR_MAINFRAME 128
#define IDB_BITMAP1 130
#define IDR_TOOLBAR1 132
#define IDI_ICON1 135
#define IDC_NewBtnTbr 135
#define IDC_ZoomInBtnTbr 136
#define IDC_ZoomOutBtnTbr 137
#define IDI_ICON2 138
#define IDC_PanBtnTbr 138
#define IDC_TXTDataFile 1001
#define IDC_EDTDataPath 1002
#define IDC_BTNBrowse 1003
#define IDC_RICHEDTHeader 1005
#define IDC_OPENGL 1009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 139
#define _APS_NEXT_COMMAND_VALUE 32776
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif
I don't know how the numbers are set? and how should I compute the number to assign to the new ID?
what's the difference between _APS_NEXT_RESOURCE_VALUE
,_APS_NEXT_COMMAND_VALUE
,_APS_NEXT_CONTROL_VALUE
and _APS_NEXT_SYMED_VALUE
?
and if I assign the number 1010 to the new ID then what should I write in front of _APS_NEXT_CONTROL_VALUE
?
and one more question that rose up is this one:
I have used the MFC/C++ Helper Class for Window Resizing from codeproject to anchor controls of dialog to it. This class uses ID of controls. and I have added a COpenGLControl from codeguru for Setting Up OpenGL in an MFC Control which does not need ID in its constructor but since it is derived from CWnd class,it has a function setHelpID
Could I add this way anIDM,IDB,IDD,IDR,IDS,IDI or IDC
(I don't know which one please help me how to choose between themand then assign this ID through function
setHelpIDto the instance of the class
COpenglControl? and then use this ID to hook the openGL window to the main window through class
CWndResizer`?
Problem solved
the way that I suggested for setting ID for the opengl window does work except that you should use SetDlgCtrlID member function instead of SetHelpID