ElSSHTunnelConnectionX objects are created by ElSSHClientX control, so you do not need to create them manually. Please call ElShellSSHTunnelX.Open() method to initiate session establishing. As soon as the session is established, ElShellSSHTunnelX object fires OnOpen event, passing the created ElSSHTunnelConnectionX instance as a parameter.

Anyway, I created a CElCustomSSHTunnelX control but there does not appear to be an Open() method

.
Hmm, it seems that ActiveX control wizard has more bugs than we expected. When creating wrappers for components, it declares methods only of the default interface of the control (ignoring all other interfaces). So if you need to access methods of non-default interface, you should explicitly request this interface using QueryInterface method and then call its methods.

Unfortunately, the only thing we can recommend is to avoid using the control wizard (i.e., to create the components in run-time). SecureBlackbox distribution includes the corresponding wrappers (.h and .c files). It may look like the following:

ElSSHTunnelListX object should be also bound to ElSSHClientX object. Please consider using ElSSHClientX.put_TunnelList method (or ElSSHClientX.SetTunnelList if you are creating components by putting them on a dialog).

Actually, you can avoid dealing with tunnels and tunnel lists at all. If you need just a simple SSH functionality (e.g., to run a shell or command), you can use ElSimpleSSHClientX control, which is much more easier to use. Moreover, ElSimpleSSHClientX contains a built-in socket, so you will not need to deal with third-party socket implementations.

Thanks for your help so far, I'm making progress. However, I don't know how to handle events from the ElSSHTunnelConnectionX since I did not create it. I need to add an entry to the event map but what Object ID do I use for this?

OK never mind. I feel like I'm trying to crack a walnut with a sledge hammer. I think I'll try the ElSimpleSSHClientX instead as you suggested. I didn't want to use the internal socket as its a blocking socket, so I'll have to use my own socket.

How can I make this work asynchronously? A DataAvailable method in ElSimpleSSHClient would solve this I think.

ElSimpleSSHClient was designed as a synchronous component. The best way to use it is to run it in a separate thread. That's why the DataAvailable() method is not published -- the component calls it internally until some operation (e.g., Open(), Receive()) is completed.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.