Click to See Complete Forum and Search --> : Communication with an UI Thread


1toulousain
September 12th, 2002, 04:48 AM
Hi, excuse me for my bad english

I have created a class (CMyclass ) which launch an UI thread. Code and methods which control this thread are included in an other class (CMyThreadClass).


How can I call an method of CMyclass from CMyThreadclass?
(I can't use a static function)

Thanks

petru66
September 12th, 2002, 10:48 AM
Would it be possible to add a field (say, "m_launcher") of type CMyclass to CMyThreadClass?

Then the launcher will probably create an object of type
CMyThreadClass, and will pass somehow "this" pointer to be stored in the field "m_launcher".

The CMyThreadClass object will be able then to call public
methods of m_launcher.

This is what I would do, based on the information from your message.

Hope it helps.
Petru