🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
5 messages
5 total messages Started by Stanislav Horal Wed, 07 Sep 2005 14:26
Problem with TIdFTPServer (BSoD)
#3500
Author: Stanislav Horal
Date: Wed, 07 Sep 2005 14:26
54 lines
2555 bytes
Hi all,

I have a little FTP server with Indy 9 components. When user connects (e.g. 
Total Commander), then disconnects, connects, disconnects...  sometimes I 
get Windows Blue Screen of Dead :-( . This is the smallest code, when this 
error still appears:

//---------------------------------------------------------------------------

void __fastcall TFormMain::FormCreate(TObject *Sender)
{
  ButtonStart->Enabled=true;
  ButtonStop->Enabled=false;
}

void __fastcall TFormMain::ButtonStartClick(TObject *Sender)
{
  FTPServer->Active=true;
  ButtonStart->Enabled=!FTPServer->Active;
  ButtonStop->Enabled=FTPServer->Active;
}

void __fastcall TFormMain::ButtonStopClick(TObject *Sender)
{
  FTPServer->Active=false;
  ButtonStart->Enabled=!FTPServer->Active;
  ButtonStop->Enabled=FTPServer->Active;
}

void __fastcall TFormMain::FTPServerListDirectory(TIdFTPServerThread 
*ASender,
      const AnsiString APath, TIdFTPListItems *ADirectoryListing)
{
  TIdFTPListItem        *LFTPItem;

  ADirectoryListing->ListFormat=flfUnix;
  ADirectoryListing->DirectoryName=APath;
  LFTPItem=ADirectoryListing->Add();
  LFTPItem->FileName="test.txt";
  LFTPItem->Size=100;
  LFTPItem->ItemType=ditFile;
  LFTPItem->ModifiedDate=Now();
  LFTPItem->OwnerName="anonymous";
  LFTPItem->GroupName="all";
  LFTPItem->OwnerPermissions="rw-";
  LFTPItem->GroupPermissions="rw-";
  LFTPItem->UserPermissions ="rw-";
}

//---------------------------------------------------------------------------

What I am doing wrong? Error appears only on non-NT platforms (98, Me).

-Stanley-
Re: Problem with TIdFTPServer (BSoD)
#3503
Author: Jonathan Benedicto
Date: Wed, 07 Sep 2005 22:24
15 lines
1664 bytes
"Stanislav Horal" <stanislav.horal@ucm.sk> wrote in message 
news:431ef874@newsgroups.borland.com...
> I have a little FTP server with Indy 9 components. When user connects 
> (e.g. Total Commander), then disconnects, connects, disconnects... 
> sometimes I get Windows Blue Screen of Dead :-( . This is the smallest 
> code, when this error still appears:

Have you tried using a different FTP app ?

And, BTW, this should not fix your problem, but you should not be using 
OnCreate. It is a Delphi remnant that is illegal in C++, because it can 
call the function before the constructor is called. Rather just set those 
two button states in the Object Inspector.

Jonathan 
Re: Problem with TIdFTPServer (BSoD)
#3504
Author: Stanislav Horal
Date: Thu, 08 Sep 2005 07:16
34 lines
2485 bytes
I tried Cerberus FTP Server, it works fine, without any BSoD. Then I stop 
it, run my tiny FTP server, make 3-times connect-disconnect and BSoD 
appears. For connection I used Total Commander and Internet Explorer with 
the same result. Using MSIE BSoD appears when window is closed (connection 
closed).

http://fpv.ucm.sk/test/FTPTest.zip

OT:
I thought that OnCreate event is called after initialization of all 
components is finished. Where can I call initialization section of my 
program (reading Registry, setting memory structures, ...) ?

-Stanley-


"Jonathan Benedicto" <incorrect@no.server> wrote in message 
news:431f685d$1@newsgroups.borland.com...
> "Stanislav Horal" <stanislav.horal@ucm.sk> wrote in message 
> news:431ef874@newsgroups.borland.com...
>> I have a little FTP server with Indy 9 components. When user connects 
>> (e.g. Total Commander), then disconnects, connects, disconnects... 
>> sometimes I get Windows Blue Screen of Dead :-( . This is the smallest 
>> code, when this error still appears:
>
> Have you tried using a different FTP app ?
>
> And, BTW, this should not fix your problem, but you should not be using 
> OnCreate. It is a Delphi remnant that is illegal in C++, because it can 
> call the function before the constructor is called. Rather just set those 
> two button states in the Object Inspector.
>
> Jonathan
> 
Re: Problem with TIdFTPServer (BSoD)
#3505
Author: Hans Galema
Date: Thu, 08 Sep 2005 07:25
14 lines
1596 bytes
Stanislav Horal wrote:

> I thought that OnCreate event is called after initialization of all 
> components is finished.

In applications developed with c++builder OnCreate can sometimes
be called even before the constructor.

 >  Where can I call initialization section of my
> program (reading Registry, setting memory structures, ...) ?

Place that code in the constructor.

Hans.
Re: Problem with TIdFTPServer (BSoD)
#3506
Author: Jayme Jeffman Filho
Date: Thu, 08 Sep 2005 11:56
13 lines
1249 bytes
> OT:
> I thought that OnCreate event is called after initialization of all
> components is finished. Where can I call initialization section of my
> program (reading Registry, setting memory structures, ...) ?
>
> -Stanley-
>
Hi,

I'd rather place it on the OnShow event where it is secure that
all components are already created.

Jayme.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads