Re: C++(MFC) SFTP with PrivateKey (General questions)
Omor,
can you try code like this (based on MFC/2. COM Object With Events sample), change void CWithEventsView::OnInitialUpdate() sample:
[code]if (!m_Ftp.CreateDispatch( WeOnlyDo.wodFtpDLXCom.1 ,NULL))
{
AfxMessageBox( Could not create wodFtpDLX object ,MB_OK,0);
return;
}
if (!m_Cert.CreateDispatch( WeOnlyDo.Certificate.1 ,NULL))
{
AfxMessageBox( Could not create Certificate object ,MB_OK,0);
return;
}
VARIANT var;
var.vt = VT_ERROR;
m_Cert.LoadKey( ... , var);
m_Cert.Load( ... , var);
// let's initialize FtpX events
m_FtpEvents = new CEventSink;;
LPUNKNOWN pUnknown= m_FtpEvents->GetIDispatch(FALSE);
AfxConnectionAdvise(m_Ftp.m_lpDispatch,DIID__IwodFtpDLXComEvents,pUnknown,FALSE,&m_Cookie);
// great, we have everything. Let's just inform events class about our existance :)
m_FtpEvents->m_pCtrl=this;
m_Ftp.SetHostname( your_hostname );
m_Ftp.SetLogin( your_login );
m_Ftp.SetPassword( not_needed );
m_Ftp.SetAuthentication(2); //authCertificate
m_Ftp.SetRefCertificate(m_Cert);[/code]
See how I set certificate and how I initialize? Can you try the same?
Regards,
Kreso
Complete thread:
- C++(MFC) SFTP with PrivateKey - OMOR, 2006-07-20, 15:44
- Re: C++(MFC) SFTP with PrivateKey - wodDrazen, 2006-07-20, 15:54
- Re: C++(MFC) SFTP with PrivateKey - wodSupport, 2006-07-20, 16:02
- Re: C++(MFC) SFTP with PrivateKey - OMOR, 2006-07-21, 08:13
- Re: C++(MFC) SFTP with PrivateKey - wodDamir, 2006-07-21, 08:51
- Re: C++(MFC) SFTP with PrivateKey - OMOR, 2006-07-21, 09:17
- Re: C++(MFC) SFTP with PrivateKey - wodSupport, 2006-07-21, 19:13
- Re: C++(MFC) SFTP with PrivateKey - OMOR, 2006-07-24, 07:57
- Re: C++(MFC) SFTP with PrivateKey - wodSupport, 2006-07-21, 19:13
- Re: C++(MFC) SFTP with PrivateKey - OMOR, 2006-07-21, 09:17
- Re: C++(MFC) SFTP with PrivateKey - wodDamir, 2006-07-21, 08:51
- Re: C++(MFC) SFTP with PrivateKey - OMOR, 2006-07-21, 08:13
- Re: C++(MFC) SFTP with PrivateKey - wodSupport, 2006-07-20, 16:02
- Re: C++(MFC) SFTP with PrivateKey - wodDrazen, 2006-07-20, 15:54