hur.cn - 华软网

 热门搜索

问下

  作者:未知    来源:网络    更新时间:2011/5/26
CString m_sPath;
m_sPath = fileDlg.GetPathName();
ShellExecute(this->m_hWnd,"open", "m_sPath","","",SW_SHOW );

m_sPath 怎么不行啊?把它换成具体文件名就可以了?
神啊!帮帮忙
---华软 网友回答---
应该用m_sfilename=fileDlg.GetFileName();
ShellExecute(this->m_hWnd,"open", "m_sfilename","","",SW_SHOW );
---华软网友回复---
这东西"m_path"能是路径吗?...
---华软网友回复---
GetPathName()是路径,运行不了的。。。
---华软网友回复---
单步调试是每个写代码的人的基本功!
---华软网友回复---
写错了吧!改成这样:
ShellExecute(this->m_hWnd,"open",(LPCTSTR)m_sPath, "","",SW_SHOW );


---华软网友回复---
ShellExecute(this->m_hWnd,"open", "m_sPath","","",SW_SHOW );
-->
ShellExecute(this->m_hWnd,"open", m_sPath,"","",SW_SHOW );
---华软网友回复---
引用 1 楼 pppp23 的回复:
应该用m_sfilename=fileDlg.GetFileName();
ShellExecute(this->m_hWnd,"open", "m_sfilename","","",SW_SHOW );


1L的回复~~~~呵呵~~~
---华软网友回复---
五楼六楼才是正解
C++">Remarks
This method allows you to execute any commands in a folder's context menu or stored in the registry. 

To open a folder, use either of the following calls: 

ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);

or 

ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);

To explore a folder, use: 

ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);

To launch the shell's Find utility for a directory, use:

ShellExecute(handle, "find", path_to_folder, NULL, NULL, 0);

     
华软声明:本内容来自网络,如有侵犯您版权请来信指出,本站立即删除。