//下面这段代码的意思是:如果打不开,就调用“打开方式”对话框,
//szPath是全路径,包括路径和文件名
int nRes =(int)ShellExecute(NULL,"open",szPath,NULL,NULL,SW_SHOWNORMAL);
// int nRes = (int)ShellExecute(NULL, "open", strName, "", pszFolder, SW_SHOWDEFAULT);
if(SE_ERR_NOASSOC == nRes)
{
CString strCmd;
strCmd.Format("rundll32 shell32, OpenAs_RunDLL %s", szPath);
WinExec(strCmd, SW_SHOWNORMAL);
}