Relative Paths (noobie question)

Discussion in 'C++' started by maharg@cinci.rr.com, Aug 24, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Howard Guest

    <> wrote in message
    news:...
    > 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
     
    Howard, Aug 24, 2006
    #2
    1. Advertising

  3. 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
     
    Victor Bazarov, Aug 24, 2006
    #3
  4. huntedsnark Guest

    Thank you both, I realized I should have posted this in the Visual C++
    group, I appreciate your help.
     
    huntedsnark, Aug 24, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Noah
    Replies:
    5
    Views:
    789
  2. Shaun
    Replies:
    2
    Views:
    560
    Simon Brunning
    Apr 22, 2005
  3. Bit Byte
    Replies:
    1
    Views:
    854
    Teemu Keiski
    Jan 28, 2007
  4. Abubakar

    a question about relative paths

    Abubakar, Mar 9, 2010, in forum: ASP .Net
    Replies:
    2
    Views:
    311
    Abubakar
    Mar 9, 2010
  5. Ohad Lutzky

    Paths, gentleman, paths

    Ohad Lutzky, Nov 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    200
    David Vallner
    Nov 7, 2006
Loading...

Share This Page