🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Indy9 - BCB5 - FTP server - access violation errors

#1759
From: Hanne B
Date: Wed, 08 Nov 2006 11:05
79 lines
3107 bytes
"Hans Galema" <notused@notused.nl> wrote in message 
news:4551ad3e$1@newsgroups.borland.com...
> Hanne B wrote:
>
>> How do I avoid such errors ?
>
> You forgot to tell which statement causes the AV.
> (which line of code?).
>
> Hans.
>


It doesn't happen in any of my lines but a short time after the code has 
been executed.

I get an exception message box:

Application Error:
Exception EAccesViolation in module FTPServer1.exe at 0000000
Access violation at address 00455B9B in module FTPServer1.exe. Read of 
address 0000000C.

Hanne




Example:

TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  IdFTPServer1->Active = true;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::IdFTPServer1UserLogin(TIdFTPServerThread *ASender,
      const AnsiString AUsername, const AnsiString APassword,
      bool &AAuthenticated)
{
  AAuthenticated = true;
}
//---------------------------------------------------------------------------
TIdFTPServerThread *AThread = NULL;

void __fastcall TForm1::IdFTPServer1RetrieveFile(
      TIdFTPServerThread *ASender, const AnsiString AFileName,
      TStream *&VStream)
{
  AThread = ASender;

  VStream = new TMemoryStream();
  for (int i = 0; i < 100000; i++)
    VStream->Write("Test", 4);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ButtonDisconnectClick(TObject *Sender)
{
  if (AThread)
  {
    if (AThread->Connection &&
        AThread->Connection->ClosedGracefully == false)
        AThread->Connection->Disconnect();

    AThread->StopMode = smTerminate;
    AThread->Stop();
  }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::IdFTPServer1Disconnect(TIdPeerThread *AThread)
{
  AThread = NULL;
}
//---------------------------------------------------------------------------
Technical Details
Message-ID: <4551ba0d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4551ac92@newsgroups.borland.com> <4551ad3e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,942ca0ee33498431
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Hanne B" <hb@aeromark.dk>
From: "Hanne B" <hb@aeromark.dk>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4551ac92@newsgroups.borland.com> <4551ad3e$1@newsgroups.borland.com>
Subject: Re: Indy9 - BCB5 - FTP server - access violation errors
Date: Wed, 8 Nov 2006 12:05:41 +0100
Lines: 81
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: 83.91.195.110
Message-ID: <4551ba0d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1162983949 83.91.195.110 (8 Nov 2006 03:05:49 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail