I solved the problem of the cancel button with the following code.
Visible = true;
SetFocus();
Close();
I have since discovered similar behavour on another form which has no buttons. (In this case I am overloading the Hide() function. I tried adding Visible=true and SetFocus(), similar to...
I tried setting Cancel to false also, but no help. I suspect you are onto something though because the other buttons on the form work OK, even when the Cancel function doesn't!
I've tried playing with the tabstop number also, and then even adding another button to the form with its on-click...
I tried your suggestion of using Close(), but am still experiencing the same behaviour. The close event seems to be being directed away from my event handler.
void __fastcall TmodemConnectDlg::CancelBtnClick(TObject *Sender)
{
// SetFocus();
// Update();
// Hide();
// Update()...
Thanks for that James. Its given me some clues for investigation. Thanks!
I wonder if I can perhaps use RAS to enumerate the ports, and determine the port names to then use in the old CreateFile() function!?
I am using the windows CreateFile() function to open and communicate to modems via a comport, but have come across some modems (especially internal modems) which present their port as a custom name in place of the usual Com1, Com2.. etc, as viewed in Hyperterminal.
LPCTSTR lpFileName...
In certain circumstances within the application which I wrote in C++ Builder 4/5, a dialog cannot be closed by pressing its cancel button. Generally I just click the Cancel button or press escape (ie I have the "Cancel" property of the button set to true) to close the dialog. The event handler...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.