Re: sharing variables between dialog boxes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Scot T Brennecke" <ScotB@xxxxxxxxxxxxxxxxxx> wrote in message
news:OUxIk5mSHHA.4872@xxxxxxxxxxxxxxxxxxxxxxx
I disagree. As Joe pointed out, you are breaking the rules of
encapsulation (forcing the second dialog to be aware of the needs of the
first dialog). The solution that Joe and I both gave is a reliable
maintainable pattern to follow.

No it was me that pointed out that your way breaks encapsulation and Joe
agreed - you have one class directly accessing the private members of
another class. However, as Joe correctly pointed out, a quick get and set
method easily solves the encapsulation problem for anyone with OO hangups!

My way does not break encapsulation at all - a pointer to a local variable
is passed from one operation to the second dialog. This is also an easily
maintainable solution.

Anyway, I have quite happy with your alternative way. Seems perfectly
reasonable, although personally I still think it is way too much work for 1
string modify!

GT


.