Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have a html file and I want to open it from my mfc application, One way is shellexecute and it works, but the problem is that you have to pass iexplorer.exe location to the shellexecute as a parameter, which is usually c:\Program Files.... but what if IE is not in c:? what if windows is in another drive like d:? Is there any other way to do this? or is there any function that returns the windows drive?
You're overthinking it. Just call ShellExecute with just the URL:
ShellExecute(0, NULL, pszURL, NULL, NULL, SW_SHOWDEFAULT);
It will open with the default browser.
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.