Relative Paths (noobie question)

M

maharg

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?
 
H

Howard

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
 
V

Victor Bazarov

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
 
H

huntedsnark

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top