DWORD excutecmd (hwnd hparent, maid, maid) <br/>{< br/> dword hret = (DWORD) ShellExecute (hparent, <br/> szoperate, lpszpathfolderfile, lpszparam, lpszdir, ncmd ); <br/> If (HRET> 32) <br/>{< br/>}< br/> else <br/>{< br/> cstring szmsg = _ T (""); <br/> # define case_err (x, y) Case (x): szmsg = _ T (Y); break; <br/> switch (HRET) <br/> {<br/> case_err (0, "the operating system is out of memory or resources. ") <br/> case_err (error_bad_format,". EXE file is invalid (non-Win32?. EXE or error in. EXE image ). ") <br/> case_err (se_err_accessdenied," the operating system denied access to the specified file. ") <br/> case_err (se_err_associncomplete," the file name association is incomplete or invalid. ") <br/> case_err (se_err_ddebusy," the DDE transaction cocould not be completed because other DDE transactions were being processed. ") <br/> case_err (se_err_ddefail," the DDE transaction failed. ") <br/> case_err (se_err_ddetimeout," the DDE transaction cocould not be completed because the request timed out. ") <br/> case_err (se_err_dllnotfound," the specified dynamic-Link Library was not found. ") <br/> case_err (se_err_fnf," the specified file was not found. ") <br/> case_err (se_err_noassoc," there is no application associated with the given file name extension. ") <br/> case_err (se_err_oom," there was not enough memory to complete the operation. ") <br/> case_err (se_err_pnf," the specified path was not found. ") <br/> case_err (se_err_share," a sharing violation occurred. ") <br/> default: szmsg. format (_ T ("unknow error % lD"), HRET); <br/>}< br/> afxmessagebox (szmsg ); <br/>}</P> <p> return HRET; <br/>}