Skip to content

Commit e82ae52

Browse files
committed
Fix experimental code
1 parent c6c757a commit e82ae52

3 files changed

Lines changed: 37 additions & 30 deletions

File tree

EasySFTP/MainWnd.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void CMainWindow::UpdateCurrentFolder(PCUIDLIST_RELATIVE lpidl)
290290
}
291291
}
292292

293-
void CMainWindow::UpdateCurrentFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder)
293+
HRESULT CMainWindow::UpdateCurrentFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder)
294294
{
295295
HRESULT hr;
296296

@@ -305,6 +305,7 @@ void CMainWindow::UpdateCurrentFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFo
305305
m_wndAddress.ChangeCurrentFolder(m_wndListViewLocal.m_lpidlAbsoluteMe);
306306
::SetFocus(m_wndListViewLocal);
307307
}
308+
return hr;
308309
}
309310

310311
void CMainWindow::UpdateCurrentFolderAbsolute(LPCWSTR lpszPath)
@@ -387,7 +388,7 @@ void CMainWindow::UpdateServerFolder(PCUIDLIST_RELATIVE lpidl)
387388
}
388389
}
389390

390-
void CMainWindow::UpdateServerFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder)
391+
HRESULT CMainWindow::UpdateServerFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder)
391392
{
392393
HRESULT hr;
393394

@@ -403,6 +404,7 @@ void CMainWindow::UpdateServerFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFol
403404
SetServerListenerToMe();
404405
::SetFocus(m_wndListViewServer);
405406
}
407+
return hr;
406408
}
407409

408410
void CMainWindow::UpdateServerFolderAbsolute(LPCWSTR lpszPath)

EasySFTP/MainWnd.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class CMainWindow :
6161
public ICommDlgBrowser,
6262
#endif
6363
public IServiceProvider,
64+
//public IOleCommandTarget,
6465
public IInternetHostSecurityManager
6566
{
6667
public:
@@ -100,6 +101,10 @@ class CMainWindow :
100101
STDMETHOD(QueryCustomPolicy)(REFGUID guidKey, BYTE** ppPolicy, DWORD* pcbPolicy,
101102
BYTE* pContext, DWORD cbContext, DWORD dwReserved);
102103

104+
//// IOleCommandTarget
105+
//STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText);
106+
//STDMETHOD(Exec)(const GUID* pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut);
107+
103108
protected:
104109
LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
105110
};
@@ -192,11 +197,11 @@ class CMainWindow :
192197
UINT m_uLastStatusTextModeID;
193198

194199
void UpdateCurrentFolder(PCUIDLIST_RELATIVE lpidl);
195-
void UpdateCurrentFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder = NULL);
200+
HRESULT UpdateCurrentFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder = NULL);
196201
void UpdateCurrentFolderAbsolute(LPCWSTR lpszPath);
197202
//void UpdateServerFolder(LPCWSTR lpszPath);
198203
void UpdateServerFolder(PCUIDLIST_RELATIVE lpidl);
199-
void UpdateServerFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder = NULL);
204+
HRESULT UpdateServerFolderAbsolute(PCUIDLIST_ABSOLUTE lpidl, IShellFolder* pFolder = NULL);
200205
void UpdateServerFolderAbsolute(LPCWSTR lpszPath);
201206
void SetServerListenerToMe();
202207
void OnChangeServerFolderFailed();

EasySFTP/MainWnd2.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,9 @@ STDMETHODIMP CMainWindow::CBrowserLocal::OnDefaultCommand(IShellView* ppshv)
705705
hr = GetSelectedIDList(ppshv, 0, NULL, &pidl);
706706
if (FAILED(hr))
707707
return hr;
708-
This()->UpdateCurrentFolderAbsolute(pidl);
708+
hr = This()->UpdateCurrentFolderAbsolute(pidl);
709709
::CoTaskMemFree(pidl);
710-
return S_OK;
710+
return hr;
711711
}
712712

713713
STDMETHODIMP CMainWindow::CBrowserLocal::OnStateChange(IShellView* ppshv, ULONG uChange)
@@ -753,23 +753,23 @@ STDMETHODIMP CMainWindow::CBrowserLocal::IncludeObject(IShellView* ppshv, PCUITE
753753
PIDLIST_ABSOLUTE lp;
754754
CMainWindow* pThis = This();
755755

756-
lp = AppendItemIDList(pThis->m_wndListViewLocal.m_lpidlAbsoluteMeCur, pidl);
756+
lp = AppendItemIDList(pThis->m_wndListViewLocal.m_lpidlAbsoluteMe, pidl);
757757
if (IsMyComputerIDList(lp))
758758
{
759759
::CoTaskMemFree(lp);
760760
return S_OK;
761761
}
762762
::CoTaskMemFree(lp);
763-
//if (pThis->m_wndListViewLocal.m_pView == ppshv)
764-
{
765-
SFGAOF rgf;
766-
HRESULT hr;
767-
hr = pThis->m_wndListViewLocal.m_pFolderCur->GetAttributesOf(1, &pidl, &rgf);
768-
//if (rgf & (SFGAO_FILESYSTEM))
769-
return S_OK;
770-
//else
771-
// return S_FALSE;
772-
}
763+
////if (pThis->m_wndListViewLocal.m_pView == ppshv)
764+
//{
765+
// SFGAOF rgf;
766+
// HRESULT hr;
767+
// hr = pThis->m_wndListViewLocal.m_pFolderCur->GetAttributesOf(1, &pidl, &rgf);
768+
// //if (rgf & (SFGAO_FILESYSTEM))
769+
// return S_OK;
770+
// //else
771+
// // return S_FALSE;
772+
//}
773773
return S_OK;
774774
}
775775

@@ -787,9 +787,9 @@ STDMETHODIMP CMainWindow::CBrowserServer::OnDefaultCommand(IShellView* ppshv)
787787
hr = GetSelectedIDList(ppshv, 0, NULL, &pidl);
788788
if (FAILED(hr))
789789
return hr;
790-
This()->UpdateServerFolderAbsolute(pidl);
790+
hr = This()->UpdateServerFolderAbsolute(pidl);
791791
::CoTaskMemFree(pidl);
792-
return S_OK;
792+
return hr;
793793
}
794794

795795
STDMETHODIMP CMainWindow::CBrowserServer::OnStateChange(IShellView* ppshv, ULONG uChange)
@@ -835,23 +835,23 @@ STDMETHODIMP CMainWindow::CBrowserServer::IncludeObject(IShellView* ppshv, PCUIT
835835
PIDLIST_ABSOLUTE lp;
836836
CMainWindow* pThis = This();
837837

838-
lp = AppendItemIDList(pThis->m_wndListViewServer.m_lpidlAbsoluteMeCur, pidl);
838+
lp = AppendItemIDList(pThis->m_wndListViewServer.m_lpidlAbsoluteMe, pidl);
839839
if (IsMyComputerIDList(lp))
840840
{
841841
::CoTaskMemFree(lp);
842842
return S_OK;
843843
}
844844
::CoTaskMemFree(lp);
845-
//if (pThis->m_wndListViewServer.m_pView == ppshv)
846-
{
847-
SFGAOF rgf;
848-
HRESULT hr;
849-
hr = pThis->m_wndListViewServer.m_pFolderCur->GetAttributesOf(1, &pidl, &rgf);
850-
//if (rgf & (SFGAO_FILESYSTEM))
851-
return S_OK;
852-
//else
853-
// return S_FALSE;
854-
}
845+
////if (pThis->m_wndListViewServer.m_pView == ppshv)
846+
//{
847+
// SFGAOF rgf;
848+
// HRESULT hr;
849+
// hr = pThis->m_wndListViewServer.m_pFolderCur->GetAttributesOf(1, &pidl, &rgf);
850+
// //if (rgf & (SFGAO_FILESYSTEM))
851+
// return S_OK;
852+
// //else
853+
// // return S_FALSE;
854+
//}
855855
return S_OK;
856856
}
857857

0 commit comments

Comments
 (0)