Basically, MFC is quit strong to handle all this things enternally, you only need to do is that give same ID to toolbar and menubar item.
If you have PQR.bmp on ID_CLICK_ME toolbar then give ID_CLICK_ME to menu bar item so it directly taken POR.bmp as menubar bitmap.
In a dialog I had replaced an CListBox with CListCtrl ... the old CListBox had used SetItemDataPtr, to store a CMyObjects pointers ... but CListCtrl does not have not such a thing (CListCtrl::SetItemDataPtr, only CListCtrl::SetItemData) ... how can I store an object pointers into CListCtrl ? Is it posible ?
Thank you so much for your answers (both of you), I will try that right away and tell you what I've done ... but it came into my mind a question ... if I could store pointers into SetItemData(...), why CListBox does have SetItemData and SetItemDataPtr ... it is not a kind of redundancy ?
I can't see anything seriously wrong in the posted code. So the error may be also somewhere else (probably in a line before number 33 in mydialog.cpp). A possible error source is forgetting the trailing semicolon after the class declaration:
class CMyDialog : public CDialog
}; // <- Don't forget the semicolon here.
I have some more notes:
You should always use parentheses with definitions and macros:
Such mistakes happen (even to me after years of programming). When forgetting the semicolon at the end of a header file, the error is thrown at the first semicolon in the next file which might be another header file or the source file. If you remember this and get such a bulk of messages the next time, you will probably know where to look first.
Last Visit: 31-Dec-99 18:00 Last Update: 3-Oct-23 23:38