Discussion:
Ftp connection via dll
(too old to reply)
Carlo
2006-07-04 09:31:17 UTC
Permalink
Hi, i am testing a particoular use of dll in Delphi.
I have an application with a component TidFtp1 (indy client ftp) and i
set up host, user and password.
I want to do the connection of TidFtp1 via dll and i need to pass the
TidFtp1 component from application to dll.
My dll must return True in connection is ok, False if connection isn't
ok.
When connection is ok, the TidFtp1 component of my application, must be
connected and i would like to use it for files update/download
(get...put...etc).

I write this code, but TidFtp1 of my application, can't connect:

// *******************
// DLL
// *******************

uses
...... IdFTP, IdAntiFreezeBase;

function _FtpConnect(_IdFtp: TIdFtp): Boolean; stdcall;
begin
try
if _IdFTP.Connected=False then
_IdFTP.Connect;
Result:=True;
except
Result:=False;
end;
end;

// *******************
// APPLICATION
// *******************
function _FtpConnect(_IdFtp: TIdFtp): Boolean;
stdcall; external 'filelib.dll';

if _FtpConnect(idFTP1)=True then
showmessage('connection ok')
else
showmessage('connection error');

Someone can help me?
Thanks
Riki Wiki
2006-07-05 20:58:17 UTC
Permalink
Post by Carlo
Someone can help me?
Hoi Carlo

You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this newsgroup
do not officially exist, use newsgroup b.p.d.internet.winsock.

How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups>

Loading...