在evc在如何实现浏览文件夹?

vivian_2007 2007-12-04 11:17:52
我想在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)
...全文
165 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
huangtaoyuan 2008-08-23
  • 打赏
  • 举报
回复
我编译怎么不过呢
载舟之水 2007-12-06
  • 打赏
  • 举报
回复
呵呵,看来你接触vc也没多久。你先在vc上把UNICODE问题调好再移植吧,把project c++ setting 中MBCS换成_UNICODE,UNICODE,就是UNICODE版本了。
vivian_2007 2007-12-06
  • 打赏
  • 举报
回复
改了半天,还是没有改好,希望高手指点。
qfeng168 2007-12-06
  • 打赏
  • 举报
回复
学习:)
91program 2007-12-05
  • 打赏
  • 举报
回复
这些都是小问题,LZ还是自己努力吧。
不可能靠别人的,只能靠自己!
vivian_2007 2007-12-04
  • 打赏
  • 举报
回复
大虾能否给小弟改一下,现在我是一头雾水,不知从哪儿下手。
91program 2007-12-04
  • 打赏
  • 举报
回复
这段程序,问题不少!
例如这名:ZeroMemory(),后面的空间大小计算有误。
GetSafeHwnd()获昨的句柄
字符串操作
kakashi0309 2007-12-04
  • 打赏
  • 举报
回复
Evc下是Unicode编码

19,502

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧