Jump to content
  • Advertisement
Sign in to follow this  
Linc

Determine absolute file paths

This topic is 4268 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I'm in the process of writing a custom auto-launch program for distribution on CD. It's been a while since I've written in C++, and I'm really fuzzy on the syntax. All I need to do it open a web browser with an html file from the cd, but the file is in a folder in the cd. I can access it just fine if the file's in the root of the CD, but would I access it in the folder. Here's what works when it's in the CD root: ShellExecute(NULL, "open", "index.htm",NULL, NULL,SW_SHOWNORMAL); But it doesn't work when I try something like: ShellExecute(NULL, "open", "html/index.htm",NULL, NULL,SW_SHOWNORMAL); Firefox says doesn't know how to open the address. Any ideas? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
My first guess would be to try using the path "./html/index.htm" or ".\\html\\index.htm". The "." means "current directory". Otherwise, you should be able to use GetModuleFileName() to determine the full path to the currently executing exe, which I'm guessing is in the root directory of the CD. Then you can parse that to get the root folder minus the exe filename.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!