Jump to content
David Schwartz

strange problem with psftp lib

Recommended Posts

I found this library: https://www.syncovery.com/tgputtylib/

 

I'm guessing it's built with D10.3 while I'm using D10.2

 

I extracted the entire file tree to a folder and rebuilt the components and libs, and set up the search paths. (I moved the output into the same file tree rather than using the default.)

 

I can run the VCL demo just fine, but the VCL Component demo blows up with an "External Exception".

 

Strangely, my app with NO component blows up with the same error.

 

I copied the code to init the lib from the VCL demo (non-component) and it blows up when it's initializing one of the DLLs. 

 

This demo even adds tgputtylib.pas and tgputtysftp.pas to the project, so I did that as well. That app works, mine blows up.

 

There's exactly one dll and one bpl file on my system, and I did a BUILD on EVERYTHING before running it.

 

Whatever is causing my app to blow up seems to be causing the same error when the component inits the DLL as well.

 

All I'm trying to do is write a bit of code that needs to upload a file to a server using the SFTP protocol, poll every minute waiting for four output files to appear, then download them.

 

These need to be called in discrete steps: Upload, wait for results, download.

 

I've tried four different libs and approaches now, and every one has quirks that keep them from working, or they're just too complicated to figure out.

 

I don't use a lot of DLLs so I'm quite baffled how one app would happily init the DLL while the other that was more-or-less cloned from the first blows up during the DLL init step.

 

Suggestions welcome (including useful code samples that I could try).

Edited by David Schwartz

Share this post


Link to post

I copied the form from the VCL demo that works into the folder with my code, added a button to pass the PSFTP object to my form instead of creating it, then tried to run it.

 

When the other form tried to initialize the DLL, it blew up in the same place. 

 

Is there supposed to be some handshaking between the client and the server when a connection is set up? I vaguely recall seeing a popup window saying the client hasn't seen this server before and asks if it's ok, and I click Yes. That thing isn't happening on my app, and it's not happening on the demo app when I moved it either.

 

I read there are a couple of libs that let you tell them to simply "accept" this thing. I'm not sure if this lib does that or not.

Share this post


Link to post

Well, I put the lime in the coconut and ... oh ... I mean ... I put the DLL in the folder with the EXE and ... it worked. 

 

I thought I'd done that earlier, but it somehow snuck into the folder next door.

  • Haha 2

Share this post


Link to post

So instead of "DLL not found" you got "External Exception". This is about how important it is to name exceptions correctly and clearly.

  • Haha 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×