Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use of hDlg in a sub-function
#1
One of my QM items calls a dialog (ShowDialog) as well as a number of sub-functions (sub) most of them declared with the "v" attribute. I wonder about the most elegant way to access hDlg in these subfunctions. Up to now, I used two alternatives:

(a) Use a "function int'hDlg" statement in each function.

(b) Declare an variable "int hw" in main, and then set its value in DlgProc, as "hw=hDlg".

They both work. However, my questions are :

(i) Is there a third solution better than these above?
(ii) Which of the above two solutions is better to be used.

Any advice will be most appreciated.
#2
(i) Two others are: 1. Thread variables. But it isn't better. 2. Class member variables. Isn't better too.
(ii) Both are good.


Forum Jump:


Users browsing this thread: 1 Guest(s)