Handling Cdialog's in a App.
-
Hello All, I have a MFC app developed in VS 6.0 User can open multiple dialogs in this app. Is there a way of keeping track of how many dialogs are open at a given time? Also, is there a way of getting the handle to each dialog from a central location? Because the dialogs are opened from different parts of the app, i.e., different files its hard to keep track of all dialogs. Any sample code will help. Thanks in advance.
-
Hello All, I have a MFC app developed in VS 6.0 User can open multiple dialogs in this app. Is there a way of keeping track of how many dialogs are open at a given time? Also, is there a way of getting the handle to each dialog from a central location? Because the dialogs are opened from different parts of the app, i.e., different files its hard to keep track of all dialogs. Any sample code will help. Thanks in advance.
-
Hello All, I have a MFC app developed in VS 6.0 User can open multiple dialogs in this app. Is there a way of keeping track of how many dialogs are open at a given time? Also, is there a way of getting the handle to each dialog from a central location? Because the dialogs are opened from different parts of the app, i.e., different files its hard to keep track of all dialogs. Any sample code will help. Thanks in advance.
Derive all of your dialogs from a common class. In that base class, override
OnInitDialog()
andOnCancel()
to adjust your counters accordingly."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Derive all of your dialogs from a common class. In that base class, override
OnInitDialog()
andOnCancel()
to adjust your counters accordingly."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
DavidCrow wrote:
Derive all of your dialogs from a common class. In that base class, override
OnInitDialog()
andOnCancel()
to adjust your counters accordingly.More specifically, write a new class
MyCDialog
which derives fromCDialog
, and implementsOnInitDialog()
andOnCancel()
as DavidCrow describes, then change all of your existing dlg classes that derive fromCDialog
to derive fromMyCDialog
. [Specifically, if a class doesn't derive fromCDialog
directly, then don't change it.]-- Harvey