Problem with fopen() - Windows CE

This is a discussion on Problem with fopen() - Windows CE ; Hi I compile programs and libs for Windows CE on linux, using a cross compilation toolchain named cegcc. I have a problem with fopen() when I compile natively. fopen() returns NULL when i use a relative path for the filename, ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Problem with fopen()

  1. Problem with fopen()

    Hi

    I compile programs and libs for Windows CE on linux, using a cross
    compilation toolchain named cegcc.

    I have a problem with fopen() when I compile natively. fopen() returns
    NULL when i use a relative path for the filename, but there is no problem
    when using an absolute path name.

    is it a known behavior with fopen ? or do you think that it's a problem
    with the toolchain ?

    thank you

  2. Re: Problem with fopen()

    Torri wrote:
    > I have a problem with fopen() when I compile natively. fopen() returns
    > NULL when i use a relative path for the filename, but there is no problem
    > when using an absolute path name.


    MS Windows CE doesn't have relative paths. This is mostly a direct result
    from not having a "current working directory" either, relative to which
    those paths would be interpreted.

    That said, you might be able to interpret those paths relative to the
    executable's directory, which you can get via GetModuleFileName().

    BTW: it also doesn't have environment variables, just to mention the other
    way in which CE is not mainstream at all.

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932


  3. Re: Problem with fopen()

    On Thu, 23 Oct 2008 13:50:00 +0200, Ulrich Eckhardt
    wrote:

    clip

    >
    >BTW: it also doesn't have environment variables, just to mention the other
    >way in which CE is not mainstream at all.


    Mostly irrelevant now, but: Windows CE version 2.0 didn't support
    fopen (just CreateFile).
    >
    >Uli


    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret, eMVP
    PenFact, Inc.
    20 Park Plaza, Suite 400
    Boston, MA 02116
    www.penfact.com
    Useful reading (be sure to read its disclaimer first):
    http://catb.org/~esr/faqs/smart-questions.html

+ Reply to Thread