Home > Software engineering >  Based on the dialog box procedure, want to turn off the ok button and the top right corner of the fo
Based on the dialog box procedure, want to turn off the ok button and the top right corner of the fo

Time:10-04

For equipment in close to shut down, there are some code, I first overloading the ok button, and then made a wm_close message response function, then the code inside the same, the same result,
I want to save trouble, later in the ok function directly call close function, but the window is shut out,
The code is as follows:

The response function of the//ok button
Void Cgrab_MFCDlg: : OnBnClickedOk ()
{
This - & gt; OnClose ();
}

Void Cgrab_MFCDlg: : OnClose ()
{
If (bCameraOpen==TRUE)
{
Res=PylonDeviceClose (hDev);
CHECK (res);
Res=PylonDestroyDevice (hDev);
CHECK (res);
Free (imgBuf);
PylonTerminate ();
}
CDialogEx: : OnClose ();
}

My idea is that the onok onclose function call, and press the fork is the same effect, but the ok button to close not to drop,

CodePudding user response:

Add CDialogEx: : OnOK ();

CodePudding user response:

OnBnClickedOk message map?
The default overload OnOK

Equipment close calls advice overloading DestroyWindow between them, this modal/non-modal can call to

CodePudding user response:

reference 1st floor shiyanzi response:
add CDialogEx: : OnOK ();


And it can perform? Because have entered the onclose, then CDialogEx: : onclose (); This line of code should be able to close the window?

CodePudding user response:

reference 1st floor shiyanzi response:
add CDialogEx: : OnOK ();


Try can indeed,
A little not understand, press the ok button, calls the onclose function, once onclose function execution, is to close the window? Why can also return to perform CDialogEx: : OnOK (); This code?
  • Related