EldoS | Feel safer!

Software components for data protection, secure storage and transfer

IElSimpleSftpClientX -> OpenFile failed

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 08/25/2009 08:51:49
by larry  (Basic support level)
Joined: 08/25/2009
Posts: 3


I am using SimpleSftpClientX ActiveX to download a file, when calling the OpenFile , it failed, the error code is 6.

but if I use the MFC wrappers CElSimpleSftpClientX, (I put the control on a dialog ) it works Ok,

what I am doing wrong to use the ActiveX Control?
I even use the the invoke method, it also failed.

IElSimpleSftpClientX *m_pClient;

IDispatch FAR* pdisp = (IDispatch FAR*)NULL;
OLECHAR FAR* szMember = L"OpenFile";

hr = CoCreateInstance(CLSID_ElSimpleSftpClientX, NULL, CLSCTX_INPROC, IID_IElSimpleSftpClientX, (void **)&m_pClient);

...some code for connection here

hr = m_pClient->QueryInterface(IID_IDispatch,(void FAR* FAR*)&pdisp);

hr = pdisp->GetIDsOfNames(IID_NULL, &szMember, 1,LOCALE_USER_DEFAULT, &dispid);

if( SUCCEEDED(hr) )
VARIANT varResult;
UINT uArgErr;

DISPPARAMS dispparams;

dispparams.cNamedArgs = 0;
dispparams.cArgs = 3;
dispparams.rgdispidNamedArgs = &dispidNamed;

dispparams.rgvarg = new VARIANTARG[3];

dispparams.rgvarg[0].vt = VT_DISPATCH;
dispparams.rgvarg[0].pdispVal = Attributes;

dispparams.rgvarg[1].vt =VT_I4;
dispparams.rgvarg[1].lVal =Modes;

dispparams.rgvarg[2].vt = VT_BSTR;
dispparams.rgvarg[2].bstrVal = Filename;

hr = m_pClient->Invoke( dispid, IID_NULL,LOCALE_SYSTEM_DEFAULT,DISPATCH_METHOD,&dispparams,&varResult, &excep, &uArgErr);
Posted: 08/26/2009 09:47:10
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

There is quite a bit of possible reasons for the issue you are encountering. Since you have provided almost no information about your project, we can just guess about the actual reason.

First of all, please check if the SFTP connection is at least being established (Open() method returns S_OK). Second, please check if DownloadFile() method works.



Topic viewed 873 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!