Article View: borland.public.cppbuilder.nativeapi
Article #8792Need help with CreateThread
From: Elias Berelian
Date: Wed, 15 Sep 2004 19:07
Date: Wed, 15 Sep 2004 19:07
41 lines
1912 bytes
1912 bytes
I am trying to create threads as needed to send queries out and wait ( in a
thread) for the response.
I am getting the following errors:
//--------------------------------------------------------------------------
-
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HANDLE TempthreadHandle = NULL ;
DWORD Tempthreadid = 0 /*, Param = 0 */;
//LPVOID lpVoid = &Param ;
TempthreadHandle = CreateThread(NULL, 0, ThreadProc, NULL, 0,
&Tempthreadid) ; // LPTestUnit1.cpp(77)
...
//--------------------------------------------------------------------------
-
LPTHREAD_START_ROUTINE TForm1::ThreadProc(LPVOID){
...
//--------------------------------------------------------------------------
-
Compile errors:
[C++ Error] LPTestUnit1.cpp(77):
E2034 Cannot convert 'unsigned long (__stdcall * (* (_closure )(void
*))(void *))(void *)'
to 'unsigned long (__stdcall * )(void *)'
[C++ Error] LPTestUnit1.cpp(77):
E2342 Type mismatch in parameter 'lpStartAddress'
(
wanted 'unsigned long (__stdcall *)(void *)',
got 'void'
)
Technical Details
Message-ID:
<41489288$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,253e76b24c2abd55,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Elias Berelian" <eliasb@voyager.snetnsa.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Need help with CreateThread Date: Wed, 15 Sep 2004 15:07:46 -0400 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 144.160.5.25 Message-ID: <41489288$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1095275144 144.160.5.25 (15 Sep 2004 12:05:44 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail