This is the mail archive of the
mailing list for the pthreas-win32 project.
RE: pthread_create(&ID, NULL, ***AC++MemberFunction***, NULL);
- From: "Bossom, John" <John dot Bossom at Cognos dot COM>
- To: "'tim dot hutt at btinternet dot com'" <tim dot hutt at btinternet dot com>, pthreads-win32 at sources dot redhat dot com
- Date: Sun, 7 Apr 2002 18:47:08 -0400
- Subject: RE: pthread_create(&ID, NULL, ***AC++MemberFunction***, NULL);
simply have your class have a static member function that you use as the
instead of a friend class and do the same as your example below.
From: Tim Hutt [mailto:firstname.lastname@example.org]
Sent: April 7, 2002 10:08 AM
Subject: Re: pthread_create(&ID, NULL, ***AC++MemberFunction***, NULL);
07/04/02 14:38:30, "XDLai" <email@example.com> wrote:
>The C++ member function must be a static function.
But now I cant call non-static member function of the same class from the
c:\t\cpp\killbot\bot.cpp(124) : error C2352: 'CBot::Connect' : illegal call
of non-static member function
c:\t\cpp\killbot\bot.h(32) : see declaration of 'Connect'
I managed to get it to work another way by having it as a global friend
function of the class, and passing a pointer to the class as the paramater:
friend void* Main(void* pData);
void* Main(void* pData)
CBot* pBot = (CBot*)pData;
Suggest any better way?
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so. Thank you.