🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8456

Threads, Functions and Classes

#8456
From: Alistair
Date: Tue, 26 Oct 2004 11:03
36 lines
1731 bytes
Help!

[C++ Error] IRCClient.h(200): E2034 Cannot convert 'unsigned long (__stdcall 
* (_closure )(void *))(void *)' to 'unsigned long (__stdcall *)(void *)'.

I realise its because I have defined the function within my class, but I 
really need it to be defined within my class!!  So how can I get around this 
conversion issue?  This works outstide of a class, but I would really like 
it to work in a class!

e.g.

class myClass
{
bool CreateThread()
{
 HANDLE Handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)SocketThread,
                                            &adtdwParam, adtdwFlags, 
&ThreadID);

}

DWORD WINAPI SocketThread(LPVOID lpParam)
{
  //THIS DOES SOMETHING
}

};


Any help regarding how to convert the function to work like this, would be 
greatly appreciated!

Cheers

Alistair 
Technical Details
Message-ID: <417e2ee6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fc124e2275bfd1e9,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Alistair" <Alistair@NoSpam.Sodoff>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Threads, Functions and Classes
Date: Tue, 26 Oct 2004 12:03:01 +0100
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 81.152.249.12
Message-ID: <417e2ee6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1098788582 81.152.249.12 (26 Oct 2004 04:03:02 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail