1

I want to convert FTP to SFTP in an old VB6 application. So I was suggested to use WinSCP.

WinSCP has WinSCPnet.dll which needs to be registered in VB6 but I am unable to add it as a reference in VB6. I tried Projects -> Reference -> Browse -> Add. But I'm getting

Can't add a reference for the specified file.

So how will I register this DLL in VB6 and use it?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Suman George
  • 51
  • 3
  • 9

3 Answers3

3

On their website I found this:

%WINDIR%\Microsoft.NET\Framework\<version>\RegAsm.exe WinSCPnet.dll /codebase /tlb
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll/codebase /tlb:WinSCPnet32.tlb
%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet64.tlb

read this part of the site:

https://winscp.net/eng/docs/library_install#registering

nabuchodonossor
  • 2,095
  • 20
  • 18
0

I am able to register WinSCP successfully. Thanks for all the help. As nabuchodonossor suggested in the post we need to first register for COM. this is the command: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet32.tlb Once this was done I went to Project -> References -> Browse -> Choose WinSCPnet32.tlb from system32 folder.

This will get the task done.

Suman George
  • 51
  • 3
  • 9
0

You should register through command line as an administrator.

I have been trying to register my .dll library for a while after switching to Windows 10 and everything was failing until I did that.

8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198