|
我想在evc下实现浏览文件夹的功能,下面是一段在vc下运行正确的代码,在evc下不能运行,我刚接触evc,请各位大虾指教!谢谢!
BROWSEINFO bi;
TCHAR buffer[MAX_PATH];
ZeroMemory(buffer,MAX_PATH);
bi.hwndOwner=GetSafeHwnd();
bi.pidlRoot=NULL;
bi.pszDisplayName=buffer;
bi.lpszTitle=_T("选择一个文件夹");
bi.ulFlags=BIF_EDITBOX;
bi.lpfn=NULL;
bi.lParam=0;
bi.iImage=0;
LPITEMIDLIST pList=NULL;
if((pList=SHBrowseForFolder(&bi))!=NULL)
{
TCHAR path[MAX_PATH];
ZeroMemory(path,MAX_PATH);
SHGetPathFromIDList(pList,path);
GetDlgItem(IDC_EDIT_PATH)->SetWindowText(path);
strpath=path;
}
--------------------Configuration: DJS - Win32 (WCE x86) Debug--------------------
Compiling...
ADD.cpp
D:\DJS\ADD.cpp(71) : error C2440: '=' : cannot convert from 'unsigned short [260]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
D:\DJS\ADD.cpp(72) : error C2440: '=' : cannot convert from 'unsigned short [8]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
D:\DJS\ADD.cpp(73) : error C2065: 'BIF_EDITBOX' : undeclared identifier
Error executing cl.exe.
DJS.exe - 3 error(s), 0 warning(s)
|
|