468,469 Members | 1,745 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,469 developers. It's quick & easy.

Relative Paths (noobie question)

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
3 4993

<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
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
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.

Similar topics

7 posts views Thread by Doug | last post: by
4 posts views Thread by Richard | last post: by
2 posts views Thread by Joe | last post: by
11 posts views Thread by MBS | last post: by
15 posts views Thread by Lars Eighner | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.