大家好啊,向大家请教个问题:
下面的退出优盘的程序,在VC6.0下可以通过,但是在VS.Net2005下调时不通过,
请大家帮忙看下,谢谢 void CProg001Dlg::OnButton5() //退出优盘
{
    char strSystemDirectory[256];
    GetSystemDirectory(strSystemDirectory, 256 );    CString strTemp = strSystemDirectory;
    strTemp += "\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll";    WinExec( strTemp, SW_SHOW );
}

解决方案 »

  1.   

    void CProg001Dlg::OnButton5() //退出优盘
    {
        TCHAR strSystemDirectory[256];
        GetSystemDirectory(strSystemDirectory, 256 );    CString strTemp = strSystemDirectory;
        strTemp += _T("\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll");    WinExec( strTemp, SW_SHOW );
      

  2.   

    void CProg001Dlg::OnButton5() //退出优盘 

        TCHAR strSystemDirectory[256]; 
        GetSystemDirectory(strSystemDirectory, 256 );     CString strTemp = strSystemDirectory; 
        strTemp += _T("\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll");     WinExec( strTemp, SW_SHOW ); 
    调试的时候,还有个编译错误:
    error C2664: 'WinExec' : cannot convert parameter 1 from 'CString' to 'LPCSTR'