Topic "Can COM work with MFC"

Author Message
lincy27
[View user's profile]

Joined: 2016-12-21
Posts: 7
Can the WINSCP COM library be used with Visual studio 6.0 and 2013 (MFC dialog based application) for implementing SFTP protocol? It has to work on both Windows XP as well as Windows 7. Any suggestions?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
Yes, it should be possible. As long as there's .NET framework installed on the target machine.
lincy27
[View user's profile]

Joined: 2016-12-21
Posts: 7
could you please throw some light on this?
I registered the WinSCPnet.dll as is explained in readme_automation.txt. That gives me a .tlb-file which I can use in the Visual Studio directory.But how do u use COM component in a MFC project?? I tried importing WinSCPnet.dll in the project, but its showing the file is binary and cannot be read. Please help
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
It's been ages, since I've done this the last time.

Maybe with can help you:
http://stackoverflow.com/q/1145768/850848
lincy27
[View user's profile]

Joined: 2016-12-21
Posts: 7
martin wrote:
It's been ages, since I've done this the last time.

Maybe with can help you:
http://stackoverflow.com/q/1145768/850848


Thanks a lot, Martin. It was of great help. Another doubt is that as mentioned in
https://winscp.net/forum/viewtopic.php?t=12369 ,
the tlb contains no description for methods. Without any methods for the main classes like SessionOptions , Session ,etc how can we invoke it from MFC application?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
Sorry, you are right. You have to use IDispatch:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms221694.aspx
lincy27
[View user's profile]

Joined: 2016-12-21
Posts: 7
Thank you so much!
Guest




martin wrote:
Sorry, you are right. You have to use IDispatch:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms221694.aspx


Hi Martin, so what would be the syntax for the Open command when IDispatch is used. Only if we know the exact syntax can we invoke the method using Invoke in IDispatch ,isn't it?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
See https://winscp.net/eng/docs/library_session_open
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