在vc6.0下,使用SHGetFolderPath,确提示error C2065: 'SHGetFolderPath' : undeclared identifier
加#include <shlobj.h>
加shell32.dll都不行啊!!
加#include <shlobj.h>
加shell32.dll都不行啊!!
解决方案 »
- vs2005的c++单元测试
- 请问vc6里怎么找不到InternetSetCookieEx?
- 还是关于进度对话框
- 通用的结构体Struct类型在程序中何处定义?急!急!急!
- 求教!如何在MDI中切换两个视?谢谢!!
- 再请问一下,vc中怎样可以得到系统时间并将时间写到数据库中?(数据库中有一个字段定义成时间日期了)
- 关于CListCtrl和CTreeCtrl
- easy的问题,但我就是不知道:VC中怎么设置DataGrid的DataSource属性,在线等待。。
- vc++的一个Q(关于对话框的)
- 关于com+的客户端安装问题
- 脚本引擎嵌入的问题
- 请问如何用VC访问C++Builder编的paradox7.0库啊
不用其他!
你给我100分吧~// 新界面#define BIF_USENEWUI 0x0050bool GetFolderX(CString* folderpath, const char* szCaption , const HWND hOwner )
{
bool retVal = false; // The BROWSEINFO struct tells the shell
// how it should display the dialog.
BROWSEINFO bi;
memset(&bi, 0, sizeof(bi)); bi.ulFlags = BIF_USENEWUI ;
// bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_DONTGOBELOWDOMAIN | BIF_STATUSTEXT;
bi.hwndOwner = hOwner;
bi.lpszTitle = szCaption; // must call this if using BIF_USENEWUI
::OleInitialize(NULL); // Show the dialog and get the itemIDList for the selected folder.
LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); if(pIDL != NULL)
{
// Create a buffer to store the path, then get the path.
char buffer[_MAX_PATH] = {'\0'};
if(::SHGetPathFromIDList(pIDL, buffer) != 0)
{
// Set the string value.
folderpath->Format("%s", buffer);
retVal = true;
} // free the item id list
CoTaskMemFree(pIDL);
} ::OleUninitialize(); return retVal;
}
// in stdafx.h
#define _WIN32_IE 0x500
#include <shlobj.h>
//-----------------
CString path;
LPTSTR p = path.GetBuffer(MAX_PATH);
HRESULT hr = ::SHGetFolderPath(CSIDL_INTERNET_CACHE, NULL, SHGFP_TYPE_CURRENT, p);
if(SUCCEEDED(hr))
{ /* succeeded */
path.ReleaseBuffer();
...your code here
} /* succeeded */
else
{ /* failed */
path.ReleaseBuffer();
...failure code here
} /* failed */
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en或者跟别人要一个100分我不要了~~~~~~~~~
一切得以解决,什么其他工作都不用做
谢谢大家!!