🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: inherited Create;

#4690
From: Alistair
Date: Fri, 02 Dec 2005 20:48
28 lines
2333 bytes
Ok lets clear things up a bit:

1. I copied and pasted my .cpp and .h code together, the reason why 
everything is qualified (i forgot to remove it!).

2. DWORD WINAPI ThreadExecute(BaseThread * pParam) is the static member 
of my class that I pass to CreateThread with 'this' as the parameter so 
I can find which instance created the thread.

3. DoExecute() doesn't exist in the code?  The DoExecute was my 
rewording of the ThreadExecute static function above.

I can't pass the pointer of a class function to CreateThread, so I pass 
a static member with the instance as a parameter 'this'.  I am trying to 
replicate the pascal version of TThread, and I want to keep everything 
tidy inside the class.  No external declarations, etc...

The code you did at the bottom is what I meant to do with my copy and 
paste, but it was early and I forgot to remove certain things.

How can i write my code so that I can get Execute of the derived code to 
  be called instead of the base class Execute, from a base class 
function called by the thread?

Thanks for you help so far.

Cheers,
Alistair
Technical Details
Message-ID: <4390b2cb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!newsfeed.inode.at!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <438e31c6$1@newsgroups.borland.com> <438e3b10$1@newsgroups.borland.com> <438eb24c$1@newsgroups.borland.com> <438ec656$1@newsgroups.borland.com> <439005f7@newsgroups.borland.com> <4390a5d0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3e5cce9567b943d3
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 02 Dec 2005 20:48:01 +0000
From: Alistair <NoSpamPlease@Somewhere.Com>
User-Agent: Thunderbird 1.4 (Windows/20050908)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: inherited Create;
References: <438e31c6$1@newsgroups.borland.com> <438e3b10$1@newsgroups.borland.com> <438eb24c$1@newsgroups.borland.com> <438ec656$1@newsgroups.borland.com> <439005f7@newsgroups.borland.com> <4390a5d0$1@newsgroups.borland.com>
In-Reply-To: <4390a5d0$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 84.9.170.38
Message-ID: <4390b2cb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1133556427 84.9.170.38 (2 Dec 2005 12:47:07 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!newsfeed.inode.at!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail