Thread: _beginthreadex and class

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    _beginthreadex and class

    I'm trying to place the function that calls _beginthreadex and the the thread function under the same class, but I get a compilation error:
    error C2276: '&' : illegal operation on bound member function expression
    Code:
    class ScanAction {
    public:
       void ScanDir(char *root);
    private:
       unsigned __stdcall LyricsThread(void *params);
    };
    
    unsigned __stdcall ScanAction::LyricsThread(void *params)
    {
       ...
    }
    
    void ScanAction::ScanDir(char *root)
    {
       ...
    
       _beginthreadex(NULL, 0, &LyricsThread, NULL, 0, &dwChildId);
    
       ...
    }
    The marked part in the code is the part giving me hard time, any idea why?
    Please note what the LyricsThread function is outside the class everything works just fine.

    Thank you.
    Last edited by Devil Panther; 05-30-2007 at 03:57 PM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed