.NET and ooRexx - OK in WIN7 but error in WIN10

Advertisement

aput
Joined:
Posts:
9
Location:
EUR

.NET and ooRexx - OK in WIN7 but error in WIN10

I use the .NET assembly. My scripting language is Open Object Rexx.
These lines of (ooRexx) code have been working fine on Windows 7 for months.
If all goes well it prints the name of the SFTP server home directory.
/** REXX **/
protocol_sftp   = 0
server     = 'sftp.******.**'
port       = 22
userid     = '*******'
passwd     = '*******'
hostkey    = 'ssh-ed25519 256 ***********************************************'
Say 'Logging on to server.....'
sessionoptions = .OLEobject~New("WinSCP.SessionOptions")
SessionOptions~sshhostkeyfingerprint = hostkey
SessionOptions~hostname   = server
SessionOptions~username   = userid
SessionOptions~password   = passwd
SessionOptions~portnumber = port
SessionOptions~Protocol   = protocol_sftp
session = .OLEobject~New("WinSCP.Session")
session~Open(sessionoptions)
Say session~Homepath
But on WIN10 these lines fail on the session~Open statement.
       *-* Compiled method "UNKNOWN" with scope "OLEObject".
    23 *-* session~Open(sessionoptions)
Error 92 running z:\winscp-test\test.rex line 23:  OLE error.
Error 92.901:  An unknown OLE error occurred (HRESULT=80070057).
Looking up 80070057 I find:
E_INVALIDARG One or more arguments are not valid
When I rewrite this script for VbScript (not included here) I have no error on WIN10, so I am assuming the DLL is installed fine.
Can anybody advise me how to debug this?
Thanks, Andre

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: .NET and ooRexx - OK in WIN7 but error in WIN10

Do you get any log file, if you enable logging using Session.SessionLogPath or Session.DebugLogPath?

Reply with quote

aput
Joined:
Posts:
9
Location:
EUR

Re: .NET and ooRexx - OK in WIN7 but error in WIN10

I added LogPath statements a follows:
....
session = .OLEobject~New("WinSCP.Session")
session~SessionLogPath = "session.txt"
session~DebugLogPath = "debug.txt"
session~Open(sessionoptions)
...
Same error, but now at the statement:
session~SessionLogPath = "session.txt"

Reply with quote

martin
Site Admin
martin avatar

Re: .NET and ooRexx - OK in WIN7 but error in WIN10

Sorry, I do not know how to help you. I have no experience with ooRexx. As COM registration seems to be OK (as VBScript works), this seems to be something about ooRexx, with which I cannot offer any help.

Reply with quote

aput
Joined:
Posts:
9
Location:
EUR

Martin,
Thanks for looking at this.
Did I say that these ooRexx/WinSCP scripts run fine on WIN7?
Just not on WIN10.
I have posted this problem also in the ooRexx community but apparently not many WinSCP users there.

Is there really no option for WinSCP to show what is happening 'inside'? Any debugging info would help me.

Thanks, Andre

Reply with quote

Advertisement

martin
Site Admin
martin avatar

You can try to set Session.DebugLogPath, to see what's happening "inside".
Though I rather expect that it's a problem outside of the assembly, you won't be able to set the property anyway. But it's worth trying.

Reply with quote

aput
Joined:
Posts:
9
Location:
EUR

If I make that the first statement after the
session = .OLEobject~New("WinSCP.Session")
then I get that same error.
Had tried that before.
Thanks anyway for the replies.
Andre

Reply with quote

aput
Joined:
Posts:
9
Location:
EUR

SOLVED.
I had registered both 32 and 64-bit DLL.
As described here (https://winscp.net/eng/docs/library_install#side-by-side) the last registered DLL will be used (in my case that was the 64-bit).
But my scripting language (oRexx) was 32-bit hence the error that the OLE object did not load.

My solution:
- unregister all (winscp /comregistration, and follow instructions)
- register only the 32-bit

Now my code runs with no errors.
Andre

Reply with quote

martin
Site Admin
martin avatar

Thanks for sharing your solution (while I'm not really sure it was 32-bit vs. 64-bit issue, as you should be able to have both).

Reply with quote

Advertisement

You can post new topics in this forum