i got a file name that is predefined as a string. can i call shellexcute without specifying the full path? like:
ShellExecute(NULL, L"open", PreDefiendFileName, NULL, NULL, 0);
what should i do otherwise if not?
You could:
I'd encourage you to think defensively about this problem. Eg ensure that the file name that is passed is actually a file ("does it have the correct extension?", "does it exist in the file system?") and then only call the ShellExecute
function if those checks pass.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.