Re: Question on Progress dialog
"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
news:TT4mj.389$5K1.384@newssvr12.news.prodigy.net...
What about addressing the problem of having to have a static method. You
won't be able to distinguish between different instances of the class.
Sometime the easy way might not fulfill every need, that's what I was
pointing out.
The static method problem is easily resolved using the same technique used
in AfxBeginThread() which takes an LPARAM parameter and passes it back to
the callback. The LPARAM can be anything, but is most often a "this"
pointer. Therefore, the static method does have access to the instance in
the LPARAM parameter.
Admittedly, it is not all that readable to do it this way, but I just don't
like extra classes, or forcing the caller to use multiple inheritance to
derive from a class just use a library. If all libraries did this, the poor
caller would have to derive from many classes, and sooner or later the
diamond problem asserts itself.
-- David