Solved

Passing AfxBeginThread a Class Function

Posted on 1998-06-10
1
1,014 Views
Last Modified: 2013-11-20
Is it possible to pass a function such as AfxBeginThread, a pointer to a Class Member Function.  So far I've only been able to create stand-alone functions (CALLBACK), and use their name to pass to functions like AfxBeginThread.

Is it possible, and can some one show me an example please?

eg
class cblah
{
  int blahfunct();
  void mainfunc();
}

class blah::mainfunc()
{
  AfxBeginThread(blahfunct, ..., ..., ..., ...);
}
This is only an example..not actual code!
0
Comment
Question by:jubjub
1 Comment
 
LVL 1

Accepted Solution

by:
Andy_Keys earned 100 total points
ID: 1317835
Only if you make the it a static member fn. eg
class cblah
{
  static int blahfunct();
  void mainfunc();
}

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now