Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / C++

[C++/MFC] : Use a Thread Delegator for your threads

Rate me:
Please Sign up or sign in to vote.
4.56/5 (6 votes)
13 Oct 2010CPOL4 min read 26.5K   5  
Wouldn't be easier if you just pass a simple function to your favourite thread creation function? Read on!

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
19 Oct 2010federico.strati
I always use a somewhat different approach, here is a class"consumer" that has embedded the thread call in a member function,the member function runs a virtual call, hence the derived classesmay implement functionality as well as passing arguments asmember data of the class. Maybe you're...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
Started programming with GwBasic back in 1996 (Those lovely days!). Found the hidden talent!

Touched COBOL and Quick Basic for a while.

Finally learned C and C++ entirely on my own, and fell in love with C++, still in love! Began with Turbo C 2.0/3.0, then to VC6 for 4 years! Finally on VC2008/2010.

I enjoy programming, mostly the system programming, but the UI is always on top of MFC! Quite experienced on other environments and platforms, but I prefer Visual C++. Zeal to learn, and to share!

Comments and Discussions