正在阅读:Internet Explorer 编程简述(三)Internet Explorer 编程简述(三)

2004-09-21 16:22 出处:CSDN 作者:CathyEagle 责任编辑:linjixiong


  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;
  }

系列文章:Internet Explorer编程简述(一) (二) (三)

察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品