Has added on the dialog box toolbar "save" and "file" button, but I don't know how to add response function, and realize the function of the code and I don't know, (I'm compiling a program of computing functions, is to want to know how to save these calculated data)
CodePudding user response:
Baidu search relevant keywords,CodePudding user response:
To solve it, I have baidu for two days, no suitableCodePudding user response:
1 add a toolbar resourcesArticle 2 creation tool in the init
//TODO: Add extra initialization here
//| CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_FIXED
if (! M_wndToolBar. CreateEx (this, TBSTYLE_FLAT WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS) | |
! M_wndToolBar. LoadToolBar (IDR_MAINFRAME))
{
AfxMessageBox (" Failed to create the toolbar \ n ");
return -1;//fail to create
}
3 response ID_XXX command
CodePudding user response:
Right click on button, add a message response, like add menu message responseCodePudding user response:
On the button to set the ID, On_Command associated to the corresponding handler, add a handler function, three stepsCodePudding user response:
Add a WM_COMMAND ON_COMMAND message mapCodePudding user response:
Or overloaded dialog OnCommand function directly withBOOL CXXXDlg: : OnCommand (WPARAM WPARAM, LPARAM LPARAM)
{
UINT uID=LOWORD (wParam);
UINT uNotify=HIWORD (wParam);
If (uNotify==BN_CLICKED)
{
The switch (uID)
{
Case (IDM_XXXX) :
{
AfxMessageBox (_T (" XXXXX "));
break;
}
}
}
Return __super: : OnCommand (wParam, lParam);
}
CodePudding user response: