MessageBox( _T("The dynamic link library ShDocVw.DLL cannot be found."), _T("Error"), MB_OK | MB_ICONSTOP ); return; } LPFNORGFAV lpfnDoOrganizeFavDlg = (LPFNORGFAV) ::GetProcAddress( hMod, "DoOrganizeFavDlg" );
if (lpfnDoOrganizeFavDlg == NULL) { MessageBox( _T("The entry point DoOrganizeFavDlg cannot be found\n") _T("in the dynamic link library ShDocVw.DLL."), _T("Error"), MB_OK | MB_ICONSTOP ); return; }
TCHAR szPath [ MAX_PATH ]; HRESULT hr;
hr = ::SHGetSpecialFolderPath( m_hWnd, szPath, CSIDL_FAVORITES, TRUE ); if (FAILED(hr)) { MessageBox( _T("The path of the Favorites folder cannot be found."), _T("Error"), MB_OK | MB_ICONSTOP ); return; }
bResult = (*lpfnDoOrganizeFavDlg) ( m_hWnd, szPath ) ? true : false;
::FreeLibrary( hMod ); } else//如果"shdocvw.dll"已经在调用者进程的地址空间中则直接使用。 { LPFNORGFAV lpfnDoOrganizeFavDlg = (LPFNORGFAV) ::GetProcAddress( hMod, "DoOrganizeFavDlg" );
if (lpfnDoOrganizeFavDlg == NULL) { MessageBox( _T("The entry point DoOrganizeFavDlg cannot be found\n") _T("in the dynamic link library ShDocVw.DLL."), _T("Error"), MB_OK | MB_ICONSTOP ); return; }
TCHAR szPath [ MAX_PATH ]; HRESULT hr;
hr = ::SHGetSpecialFolderPath( m_hWnd, szPath, CSIDL_FAVORITES, TRUE ); if (FAILED(hr)) { MessageBox( _T("The path of the Favorites folder cannot be found."), _T("Error"), MB_OK | MB_ICONSTOP ); return; }
|