Wheres the love??!

Dexter Casey wrote:

> Here is the code I am using.  Connection doesn't work.  Any ideas?  Dave?
>
> use Win32::OLE;
>
> $Class = "HclFtp.Engine";
> $FtpEngine = Win32::OLE->CreateObject( $Class );
> if( ! $FtpEngine )
> {
>  $FtpEngine = new Win32::OLE( $Class, ) || die "Could not create an OLE '$Class'
> object";
>  }
> $FtpSessions = $FtpEngine->Sessions;
> if( ! $FtpSessions ){print "error is $!\n";}
> else {print "$FtpSessions is established\n";}
> $Ftp1 = $FtpSessions->NewSession;
> if( ! $Ftp1 ){print "error is $!\n";}
> else {print "$Ftp1 is established\n";}
>
> $Ftp1->{ServerName}="hamstc105.ms.com";
> $Ftp1->{UserName} = "caseyd";
> $Ftp1->{Password} = "uhuhok00";
> $Ftp1->{LocalDirectory} = "c:/temp";
> $Ftp1->{InitialHostDirectory} = "~caseyd/.custom";
> $Ftp1->ConnectToHost() || die "Could not connect to host $!\n";
>
> Dexter Casey wrote:
>
> > Having read all the OLE stuff I can find and absorbed as much.
> > I can now create an FTP engine and establish a session and set properties for host
> > username and password.  I cannot however call methods to ConnectToHost() or
> > UserLogin().
> > Does no one have any experience of this?
> >
> > rgds
> >
> > Dex
> >
> > Dexter Casey wrote:
> >
> > > Hello,
> > >
> > > Has anyone successfully managed to control these two application via
> > > Perl using win32::OLE?
> > > I have some examples of basic scripts that control these but I want to
> > > do it from Perl and so far cannot create an instance of it
> > >
> > > This is a snipet that should start FTP.exe
> > >
> > > use Win32::OLE;
> > > $Machine = "\\\\ha031515";
> > > $classID= "HclFtp.Engine";
> > > $Class = [$Machine, $classID];
> > > $HostEx = Win32::OLE->GetActiveObject( $Class );
> > > if( ! $HostEx )
> > > {
> > >     $HostEx = new Win32::OLE( $Class, ) || die "Could not create an OLE
> > > '$Class' object";
> > > }
> > > $Sessions = "FtpEngine.Sessions";
> > >
> > > but I get this.
> > >
> > > Name "main::Sessions" used only once: possible typo at hummingbird.pl
> > > line 10.
> > > Win32::OLE(0.1501) error 0x800401f3: "Invalid class string" at
> > > hummingbird.pl line 5
> > >         eval {...} called at hummingbird.pl line 5
> > >
> > > Help!
> > >
> > > --
> > > Dexter Casey
> > > FA&O IT Support
> > >
> > > _______________________________________________
> > > Perl-Win32-Admin mailing list
> > > [EMAIL PROTECTED]
> > > To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
> >
> > _______________________________________________
> > Perl-Win32-Admin mailing list
> > [EMAIL PROTECTED]
> > To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
>
> --
> Dexter Casey
> FA&O IT Support
>
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

--
Dexter Casey
FA&O IT Support


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to