BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

NMFTP (access violation Error)

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Sudesh
Guest





PostPosted: Thu Apr 29, 2004 10:21 am    Post subject: NMFTP (access violation Error) Reply with quote



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





PostPosted: Thu Apr 29, 2004 11:37 am    Post subject: Re: NMFTP (access violation Error) Reply with quote



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





PostPosted: Thu Apr 29, 2004 12:23 pm    Post subject: Re: NMFTP (access violation Error) Reply with 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?
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





PostPosted: Thu Apr 29, 2004 2:04 pm    Post subject: Re: NMFTP (access violation Error) Reply with quote

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





PostPosted: Thu Apr 29, 2004 6:25 pm    Post subject: Re: NMFTP (access violation Error) Reply with 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

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





PostPosted: Thu Apr 29, 2004 7:32 pm    Post subject: Re: NMFTP (access violation Error) Reply with quote


"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





PostPosted: Thu Apr 29, 2004 7:37 pm    Post subject: Re: NMFTP (access violation Error) Reply with quote

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





PostPosted: Thu Apr 29, 2004 7:38 pm    Post subject: Re: NMFTP (access violation Error) Reply with quote

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





PostPosted: Fri Apr 30, 2004 3:59 am    Post subject: Re: NMFTP (access violation Error) Reply with quote

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





PostPosted: Fri Apr 30, 2004 7:54 am    Post subject: Re: NMFTP (access violation Error) Reply with quote

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





PostPosted: Fri Apr 30, 2004 11:15 am    Post subject: Re: NMFTP (access violation Error) Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.