473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 5284

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by...
5
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
4
by: Richard | last post by:
Sorry about the cross posting to this group but I posted this question for a coworker last week in the setup board and got no help: hi, If my project has subfolders and I have relative paths...
0
by: Jason Lawrence | last post by:
I have an attributed ATL project (call it B) that I am building with Microsoft Visual C++ .NET (55537-640-3684941- 18356). In the project I include the COM generated file A.h (from another ATL...
2
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
11
by: MBS | last post by:
I am playing around with some PHP code. I want to put in an include() function so I can include existing HTML code and output it to the browser. Lo and behold PHP does not support relative paths...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
2
by: BD | last post by:
Hi there. Using 8.2 on Windows. I have a situation where I have a db backup, which I want to deploy to a group of developer workstations. The target directory for the database files will be...
2
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.