By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,053 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,053 IT Pros & Developers. It's quick & easy.

Relative Paths (noobie question)

P: n/a
Hi,

I have a small application that displays an html file locally from the
hard drive.

Using Navigate2, I would like to launch the html from the same
directory using a relative path.

Right now I have:

Navigate2(_T("T:\\file.html"),NULL,NULL);

Instead of specifying the drive letter I would just like the program to
look in it's own directory. Is this possible?

Aug 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

<ma****@cinci.rr.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I have a small application that displays an html file locally from the
hard drive.

Using Navigate2, I would like to launch the html from the same
directory using a relative path.

Right now I have:

Navigate2(_T("T:\\file.html"),NULL,NULL);

Instead of specifying the drive letter I would just like the program to
look in it's own directory. Is this possible?
This isn't really a C++ language question.

However, on the systems I work with, the "current" directory is often
specified as ".\" (or maybe ".\\", if \ is an escape character?), or as "./"
(again, perhaps that's ".//", I'm not sure). BUT!... the "current"
directory may not be what you think it is. You may need to query the system
for the path to "its own directory".

For the definitive answer, you should ask in a newsgroup where "Navigate2"
is a known term, since that's not part of the C++ language. Perhaps a
Windows newsgroup, on the news.microsoft.com server?

-Howard


Aug 24 '06 #2

P: n/a
ma****@cinci.rr.com wrote:
I have a small application that displays an html file locally from the
hard drive.

Using Navigate2, I would like to launch the html from the same
directory using a relative path.

Right now I have:

Navigate2(_T("T:\\file.html"),NULL,NULL);

Instead of specifying the drive letter I would just like the program
to look in it's own directory. Is this possible?
Are you asking how to remove the "T:\\" from your path? First off, you
need to define how to tell apart whatever path you have and what you mean
by "relative path". Then you need to define the steps you need to take
to convert the former into the latter. Then you need to write code that
takes those steps. This usually falls under "string manipulation",
AFAICT. Of course, if your string is hard-coded like in your example,
it needs to be done inside 'Navigage2' function or you need to assign the
value to a string (object) and manipulate it...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 24 '06 #3

P: n/a
Thank you both, I realized I should have posted this in the Visual C++
group, I appreciate your help.

Aug 24 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.