I have installed the pump as per below at the very end of setting up a modeless dialog, and it appears to function. Since I am still waiting for delivery of the Petzold book, everything I do is necessarily experimental to begin with, and when it WORKS, I use it - though it may quite possibly be a bad solution, the sole criterion has to be, for the nonce, whether it works or not.
(... code placing controls on dialog here ...)
Dialog Show Modeless hDlg& Call hDlgProc
End Select
Do
Dialog DoEvents
Dialog Get Size hDlg& To X0&,X0&
If X0&>0 Then FormOK$=CheckFields (ScrnName$)
Loop Until IsFalse X0&
End Function
The DLL function called CheckFields refers to the parameter which tells which screen is in action, and checks whether any essential information for that screen has been omitted. If so, it returns a string listing these, otherwise it returns "OK.
It appears to me (in my ignorance) that this "pump" pumps all the time, no matter what one does, even when just staring at the screen. Is this correct? If so, one could use this to ensure that the user does not leave the current screen before it is complete and correct. Would be quite something if this is so, and it almost seems as if it is! Excuse an old DOS programmer's
fumbling in the dark, but any comments would be appreciated.
(... code placing controls on dialog here ...)
Dialog Show Modeless hDlg& Call hDlgProc
End Select
Do
Dialog DoEvents
Dialog Get Size hDlg& To X0&,X0&
If X0&>0 Then FormOK$=CheckFields (ScrnName$)
Loop Until IsFalse X0&
End Function
The DLL function called CheckFields refers to the parameter which tells which screen is in action, and checks whether any essential information for that screen has been omitted. If so, it returns a string listing these, otherwise it returns "OK.
It appears to me (in my ignorance) that this "pump" pumps all the time, no matter what one does, even when just staring at the screen. Is this correct? If so, one could use this to ensure that the user does not leave the current screen before it is complete and correct. Would be quite something if this is so, and it almost seems as if it is! Excuse an old DOS programmer's
fumbling in the dark, but any comments would be appreciated.
Comment