I have downloaded the famous KBBar Microsoft sample to create a custom tool bar.
I want to make the first button as the login button and pop up a dialog box when the user clicks it.
I created the Dialog class but can't seem to call the DoModal() method. It doesn't work through the command() method. If I put the call in create(), to test, it does pop up so I know that there isn't any problem with my class creation.
Can someone help me to understand how to do this. I am new to C++ so any detailed help will be appreciated.
Well, when asking for some specific problem, plz provide as much details as you can. Like which Microsoft sample we are talking about here? How you have implemented it, what errors do you get. Most likely, others senior members will be able to dig out the problem for you, if needed, they'll ask you to provide the complete code. But with vague information, its not possible to provide some concrete solution. I hope you understand what I mean
Download and unzip the file to get the source code / files.
KBToolbarCtrl.cpp is the file used to control the actions from the toolbar buttons.
I have added a Dialog class (base class is CDialog) to the project.
I can successfully invoke the dialog when I put the dlg.DoModal(); statement in
bool CKBToolBarCtrl::Create(CRect rcClientParent, CWnd* pWndParent, CKBBarBand* pBand) method but this is not what I need.
I want to invoke my dialog when I click on the first button of the toolbar.
Here is the onCommand function of the cpp file
const MSG* pMsg = GetCurrentMessage();
int nID = LOWORD(pMsg->wParam);