From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16060 invoked by alias); 7 Apr 2002 22:51:21 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 16029 invoked from network); 7 Apr 2002 22:51:20 -0000 Received: from unknown (HELO sotr0085.cognos.com) (205.210.232.62) by sources.redhat.com with SMTP; 7 Apr 2002 22:51:20 -0000 Received: by sotr0085.cognos.com with Internet Mail Service (5.5.2653.19) id ; Sun, 7 Apr 2002 18:47:07 -0400 Message-ID: <430F887D415DD1118C2700805F31ECF106B58F80@sota0005.cognos.com> From: "Bossom, John" To: "'tim.hutt@btinternet.com'" , pthreads-win32@sources.redhat.com Subject: RE: pthread_create(&ID, NULL, ***AC++MemberFunction***, NULL); Date: Sun, 07 Apr 2002 15:51:00 -0000 MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2002/txt/msg00048.txt.bz2 simply have your class have a static member function that you use as the mainline instead of a friend class and do the same as your example below. -----Original Message----- From: Tim Hutt [mailto:tim.hutt@btinternet.com] Sent: April 7, 2002 10:08 AM To: pthreads-win32@sources.redhat.com Subject: Re: pthread_create(&ID, NULL, ***AC++MemberFunction***, NULL); 07/04/02 14:38:30, "XDLai" 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 thread function: 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: CBot class { friend void* Main(void* pData); bool OtherMemberFunction(); } void* Main(void* pData) { CBot* pBot = (CBot*)pData; pBot->OtherMemberFunction(); } 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.