请教VC高手 ShellExecute函数问题
请教VC高手,在应用ShellExecute函数时ShellExecute(this>m_hWnd,"open","c:\linez.exe",NULL,NULL,SW_...
请教VC高手,在应用ShellExecute函数时
ShellExecute(this>m_hWnd,"open","c:\linez.exe",NULL,NULL,SW_SHOW);
其中 第三个参数 c:\linez.exe 只在一级(根目录下能被启动起来)再多一级目录遍启动不起来了,请教高手是何缘故,有礼了!
下面是一个最简单的MFC程序中的函数:
void CMy1212View::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
char shell[]="c:\ots\ben\lyk6";
LPCTSTR lpFile;
lpFile=(LPCTSTR)shell;
// lpFile[13]="C:\linez.exe" ;
// ShellExecute(this->m_hWnd,"open","C:\linez.exe",NULL,NULL,SW_SHOW);
// ShellExecute(this->m_hWnd,"open","c:\linez.exe",NULL,NULL,SW_SHOW);
// ShellExecute(this->m_hWnd,"open","c:\lyk6",NULL,NULL,SW_SHOW);
ShellExecute(this->m_hWnd,"open",lpFile,NULL,NULL,SW_SHOW);
CView::OnLButtonDblClk(nFlags, point);
} 展开
ShellExecute(this>m_hWnd,"open","c:\linez.exe",NULL,NULL,SW_SHOW);
其中 第三个参数 c:\linez.exe 只在一级(根目录下能被启动起来)再多一级目录遍启动不起来了,请教高手是何缘故,有礼了!
下面是一个最简单的MFC程序中的函数:
void CMy1212View::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
char shell[]="c:\ots\ben\lyk6";
LPCTSTR lpFile;
lpFile=(LPCTSTR)shell;
// lpFile[13]="C:\linez.exe" ;
// ShellExecute(this->m_hWnd,"open","C:\linez.exe",NULL,NULL,SW_SHOW);
// ShellExecute(this->m_hWnd,"open","c:\linez.exe",NULL,NULL,SW_SHOW);
// ShellExecute(this->m_hWnd,"open","c:\lyk6",NULL,NULL,SW_SHOW);
ShellExecute(this->m_hWnd,"open",lpFile,NULL,NULL,SW_SHOW);
CView::OnLButtonDblClk(nFlags, point);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询