Topic "vb6 COM libary"

Author Message
rdejournett
[View user's profile]

Joined: 2014-10-10
Posts: 2
I installed the COM library and I can see it in the object browser in VB6, but many of the classes have nothing in them, like session. Further when I try to store & then retrieve session variables like in the demo the application crashes. I need to use VB6 I think for fixing a legacy program, so what I want to know is, is it possible to use the COM library in VB6? Am I missing something?

Here is some code. I know it's getting to the sub because the first MsgBox is firing.

Private session As WinSCPnet.session

Private Sub SendWinSCP()
MsgBox ("in SendWinSCP")
Set sessionOptions = New WinSCPnet.sessionOptions

sessionOptions.HostName = "example.com"

MsgBox ("in SendWinSCP4 " & sessionOptions.HostName & "!")
' at this point it crashes since HostName can not be found.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
I do not have VB6 to test this myself. But WinSCP .NET assembly works correctly in VBA, so I hope that it works in VB6 too.
rdejournett
[View user's profile]

Joined: 2014-10-10
Posts: 2
It works fine, I needed to add "On Error Resume Next". Most of the classes are indeed hidden but work fine.

I was able to use the VBA code and send a file via SFTP using VB6.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License