Jump to content


Photo

SFTPConnection


  • Please log in to reply
3 replies to this topic

#1 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 13 March 2009 - 02:17 PM

I have problems implementing SFTP with VB6 and ActiveX-Exe.

In the IDE everthing works fine, but as soon I try it with the compiled Exe it crashes at the Connect method of SFTPConnection:
If objSFTP.Connect = sfFTPLib.enumError.ftpErrorSuccess Then

Any ideas?

For FTP I have used the FTPConnectionSTA class:
(Use this class only if your environment doesn't support multiple threads. e.g. VB6, VBScript, JavaScript. In all other cases use the FTPConnectionMTA class instead.)

Is there also a STA class for SFTP?

Thanks in advance!

BR Markus

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 13 March 2009 - 08:55 PM

Hello Markus ..

There is no STA class for the SFTPConnection object. It seems in the release build VB6 cannot handle events that come from another thread. You can try to remove all event handlers for the SFTPConnection if you have any. This is the way VBScript/Javascript works when using the SFTPConnection class.

Regards,
Mat

#3 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 16 March 2009 - 04:17 PM

I have tried your sample project. As soon it is compiled with "WithEvents" it crashes ...
That means that with VB6 it's not possible to have a status information about transfer progress??

Because you can't show an user an up-/download without a progressbar ...

Isn't there a way to solve this?

Regards,
Markus

#4 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 16 March 2009 - 06:15 PM

Yes that's correct. Events do not work in VB6. My recommendation is to convert your project to VB.NET if possible.

Regards,
Mat




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users