_beginthread & calling a class member function

This is a discussion on _beginthread & calling a class member function within the C++ Programming forums, part of the General Programming Boards category; I have a class with public functions & member variables. Within one of its function definitions I am calling _beginthread ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    20

    _beginthread & calling a class member function

    I have a class with public functions & member variables. Within one of its function definitions I am calling _beginthread to do a longer function. That longer functions is of that class from which I called _beginthread. I cannont pass the additional thread any variables:
    Code:
    void __cdecl FUNCTION(void *)
    {
    ClassFunction();
    
    _endthread();
    }
    How can I access any member functions with out an object?

    Thanks!

  2. #2
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    You can't.

    While it's possible to access static member functions without an object, they in turn can only use other static member functions/data.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  2. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 09:56 AM
  3. Replies: 6
    Last Post: 04-27-2006, 11:55 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 01:18 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21