🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #3654

TIdThreadComponent

#3654
From: Curt
Date: Sat, 13 Aug 2005 17:46
20 lines
1454 bytes
I added a TIdThreadComponent and a push button to a form.  When the button
is pressed the following code is executed to simply start and stop the
thread:

void __fastcall TForm1::cxButton1Click(TObject Sender)
{
  if (ThreadComponent1->Stopped == true) {
    ThreadComponent1->Start();
  } else {
    ThreadComponent1->Stop();
  }
  return;
}

This code works well when the TIdThreadComponent is initially set to
"Active=true" in the IDE however if the Active property is initially set to
"false" then I get an access violation.  Can someone please tell me why ?

Thank you,
Curt
Technical Details
Message-ID: <42fe315e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ddd659176ded7d7,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Curt" <noemailaddress>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: TIdThreadComponent
Date: Sat, 13 Aug 2005 12:46:15 -0500
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
NNTP-Posting-Host: 65.43.122.173
Message-ID: <42fe315e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1123955038 65.43.122.173 (13 Aug 2005 10:43:58 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail