| View previous topic :: View next topic |
| Author |
Message |
Sudesh Guest
|
Posted: Thu Apr 29, 2004 10:21 am Post subject: NMFTP (access violation Error) |
|
|
Hi Group:
I was trying NMFTP example from the help file. I am able to connect but at
the following line get an access violation error.
StringGrid1->RowCount = NMFTP1->FTPDirectoryList->name->Count;
Any idea?
Thanks,
Sudesh
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Thu Apr 29, 2004 11:37 am Post subject: Re: NMFTP (access violation Error) |
|
|
Sudesh wrote:
| Quote: | I was trying NMFTP example from the help file. I am able to connect but at
the following line get an access violation error.
StringGrid1->RowCount = NMFTP1->FTPDirectoryList->name->Count;
|
Well with that code the problem could be at two places.
Please first discover the exact place with:
int RowCount = NMFTP1->FTPDirectoryList->name->Count;
if ( RowCount < 0 )
{
Showmessage ( IntToStr ( RowCount ) );
// Yes I know that IntToStr is not needed.
RowCount = 0;
}
StringGrid1->RowCount = RowCount;
Where is the access violation now ?
Hans.
|
|
| Back to top |
|
 |
Sudesh Guest
|
Posted: Thu Apr 29, 2004 12:23 pm Post subject: Re: NMFTP (access violation Error) |
|
|
Yes Hans, i had tried it assigning to a variable first. but gives same error
at that line.
I have just 2 files in the folder.
any idea?
thanks
Sudesh
"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote
| Quote: | Sudesh wrote:
I was trying NMFTP example from the help file. I am able to connect but
at
the following line get an access violation error.
StringGrid1->RowCount = NMFTP1->FTPDirectoryList->name->Count;
Well with that code the problem could be at two places.
Please first discover the exact place with:
int RowCount = NMFTP1->FTPDirectoryList->name->Count;
if ( RowCount < 0 )
{
Showmessage ( IntToStr ( RowCount ) );
// Yes I know that IntToStr is not needed.
RowCount = 0;
}
StringGrid1->RowCount = RowCount;
Where is the access violation now ?
Hans.
|
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Thu Apr 29, 2004 2:04 pm Post subject: Re: NMFTP (access violation Error) |
|
|
Sudesh wrote:
| Quote: | Yes Hans, i had tried it assigning to a variable first. but gives same error
at that line.
I have just 2 files in the folder.
any idea?
|
Are there NULL pointers ?
Try:
if ( NMFTP1
&& NMFTP1->FTPDirectoryList
&& NMFTP1->FTPDirectoryList->name
)
{
int RowCount = NMFTP1->FTPDirectoryList->name->Count;
}
else
ShowMessage ( "Wrong pointer(s)" );
Hans.
|
|
| Back to top |
|
 |
Sudesh Guest
|
Posted: Thu Apr 29, 2004 6:25 pm Post subject: Re: NMFTP (access violation Error) |
|
|
yes NMFTP1->FTPDirectoryList pointer is null.
so what is the reason? & remedy?
The directory exists on the server.
Thanks,
Sudesh
"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote
| Quote: | Sudesh wrote:
Yes Hans, i had tried it assigning to a variable first. but gives same
error
at that line.
I have just 2 files in the folder.
any idea?
Are there NULL pointers ?
Try:
if ( NMFTP1
&& NMFTP1->FTPDirectoryList
&& NMFTP1->FTPDirectoryList->name
)
{
int RowCount = NMFTP1->FTPDirectoryList->name->Count;
}
else
ShowMessage ( "Wrong pointer(s)" );
Hans.
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Apr 29, 2004 7:32 pm Post subject: Re: NMFTP (access violation Error) |
|
|
"Sudesh" <sudeshc (AT) vfemail (DOT) net> wrote
| Quote: | yes NMFTP1->FTPDirectoryList pointer is null.
|
Did you call the List() method first?
Gambit
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Thu Apr 29, 2004 7:37 pm Post subject: Re: NMFTP (access violation Error) |
|
|
Sudesh wrote:
| Quote: | yes NMFTP1->FTPDirectoryList pointer is null.
so what is the reason? & remedy?
The directory exists on the server.
|
Did you send a command first to read out the
directory ?
Hans.
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Thu Apr 29, 2004 7:38 pm Post subject: Re: NMFTP (access violation Error) |
|
|
Sudesh wrote:
| Quote: | The directory exists on the server.
|
Which directory ?
How could the FTP-server know about that directory ?
Hans.
|
|
| Back to top |
|
 |
Sudesh Guest
|
Posted: Fri Apr 30, 2004 3:59 am Post subject: Re: NMFTP (access violation Error) |
|
|
Sorry, looking at the help example again, I found that I had forgot to set
ParseList to true. Let me try now. I am trying to build a program like
ws_ftp. how simple (or difficult) is it??
Thanks,
Sudesh
"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote
| Quote: | Sudesh wrote:
The directory exists on the server.
Which directory ?
How could the FTP-server know about that directory ?
Hans.
|
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Fri Apr 30, 2004 7:54 am Post subject: Re: NMFTP (access violation Error) |
|
|
Sudesh wrote:
| Quote: | ...I am trying to build a program like
ws_ftp. how simple (or difficult) is it??
|
Did you ask Ipswitch, Inc. already ?
You could do it simple or difficult. <g>
Hans.
|
|
| Back to top |
|
 |
Sudesh Guest
|
Posted: Fri Apr 30, 2004 11:15 am Post subject: Re: NMFTP (access violation Error) |
|
|
Sorry but still I am not able to get NMFTP1->FTPDirectoryList->name->Count.
Anybody successful in getting the example in the help file work?
Thanks,
Sudesh
"Sudesh" <sudeshc (AT) vfemail (DOT) net> wrote
| Quote: | yes NMFTP1->FTPDirectoryList pointer is null.
so what is the reason? & remedy?
The directory exists on the server.
Thanks,
Sudesh
"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote in message
news:409109c6$1 (AT) newsgroups (DOT) borland.com...
Sudesh wrote:
Yes Hans, i had tried it assigning to a variable first. but gives same
error
at that line.
I have just 2 files in the folder.
any idea?
Are there NULL pointers ?
Try:
if ( NMFTP1
&& NMFTP1->FTPDirectoryList
&& NMFTP1->FTPDirectoryList->name
)
{
int RowCount = NMFTP1->FTPDirectoryList->name->Count;
}
else
ShowMessage ( "Wrong pointer(s)" );
Hans.
|
|
|
| Back to top |
|
 |
|