Article View: borland.public.cppbuilder.nativeapi
Article #286Re: Delphi threading by example article in C++ Builder 2007 format
From: na
Date: Wed, 28 May 2008 20:35
Date: Wed, 28 May 2008 20:35
28 lines
1742 bytes
1742 bytes
Thank you Remy. Would you mind inspecting the following to see if it looks ok? It is very
brief to keep it simple. It works on my Quad core...
//File.h
class MSGObject
{
private:
public:
std::string sLogMessage;
std::string sWrkStation;
};
//File.cpp
void TForm1::OnMessage(TMessage & Message)
{
if (Message.WParam == TH_COMPUTER)
{
MSGObject* pMSGObj = (MSGObject*)Message.LParam;
lb_Computer->Caption = pMSGObj->sWrkStation.c_str();
delete pMSGObj;
pMSGObj = 0;
}
}
//From a Thread
MSGObject * MSGObj = new MSGObject;
MSGObj->sWrkStation = "Some Value";
PostMessage(Form1->Handle, TH_MESSAGE, TH_COMPUTER, (long)MSGObj);
Technical Details
Message-ID:
<483dc218$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng1.kpn.DE!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<483da620$1@newsgroups.borland.com> <483dbcbb$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dc2961ba4f932b22 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "na" <na@na.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <483da620$1@newsgroups.borland.com> <483dbcbb$1@newsgroups.borland.com> Subject: Re: Delphi threading by example article in C++ Builder 2007 format Date: Wed, 28 May 2008 15:35:39 -0500 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.3959 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 NNTP-Posting-Host: 24.248.210.29 Message-ID: <483dc218$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1212006936 24.248.210.29 (28 May 2008 13:35:36 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng1.kpn.DE!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail