none
Availibility of GetCurrentDirectory() API with WinCE 5.0 (STANDARDSDK_500) RRS feed

  • Question

  • Hi All

    I'am trying to get the path of my application using GetCurrentDirectory() API but I got the following warning

    warning C4013: 'GetCurrentDirectory' undefined; assuming extern returning int

    I think that this API is not available with WinCE 5.0

    Could someone help me?

    Thanks.

    Tuesday, September 15, 2015 5:15 PM

Answers

  • GetCurrentDirectory is not supported in WinCE 5.0. Try GetModuleFileName() which gives you the path and filename of your process if you pass in NULL for the handle https://msdn.microsoft.com/en-us/library/ms885629.aspx 
    • Proposed as answer by Bill at Brady Tuesday, September 15, 2015 7:59 PM
    • Marked as answer by MRAB Thursday, September 17, 2015 8:24 AM
    Tuesday, September 15, 2015 7:59 PM

All replies

  • GetCurrentDirectory is not supported in WinCE 5.0. Try GetModuleFileName() which gives you the path and filename of your process if you pass in NULL for the handle https://msdn.microsoft.com/en-us/library/ms885629.aspx 
    • Proposed as answer by Bill at Brady Tuesday, September 15, 2015 7:59 PM
    • Marked as answer by MRAB Thursday, September 17, 2015 8:24 AM
    Tuesday, September 15, 2015 7:59 PM
  • Bill is correct about the GetCurrentDirectory().  Windows CE/Compact does not have the concept of current directory, so an API to get the current directory doesn't make sense.

    Note that GetModuleFileName() give the folder that the EXE resides in, which Bill states, but that is not necessarily the current folder if you are doing something like running the EXE from the command line.

    What are you really trying to do?  If we know that, maybe we can make suggestions.



    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for Eurotech

    Wednesday, September 16, 2015 1:29 PM
    Moderator
  • Hi Bruce,

    I'am trying to get the path of my EXE in order to made a log file in the same path.

    Kind Regards

    Thursday, September 17, 2015 8:27 AM