locked
How to replace windows API "GetModuleFileName" for windows store app(metro) ?

    Question

  • I rebuild my win32 project (create dll) to support windows store App by VS2012.

    I set project's property->Configuration Properties->General->Windows Store App Support  is  "Yes" ,

    then I found Windows API "GetModuleFileName" can not be used in windows store style . Which Windows store API can replace it ? 

    I feel  hard to find useful information on msdn about Windows API reference to Windows store API , Who can support some more effectivef way ?

    Wednesday, April 10, 2013 10:50 AM

Answers

All replies

  • Hi H,

    There is no WinRT equivalent for this API.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, April 10, 2013 1:34 PM
    Moderator
  • windows store app no need to get the path of loaded dll as the interface do in desktop App ? WHY ?

    Thursday, April 11, 2013 2:18 AM
  • Hi H,

    I don't understand your question.  Can you rephrase it please?

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, April 11, 2013 12:47 PM
    Moderator
  • Hi jeff ,

    Maybe I do not describe clearly about my case . 

    In my source code exist a Windows API "GetModuleFileName" . I want to rebuild the code to support windows store and there is no "GetModuleFileName" in windows store API , so I need to replace the interface by one equal windows store API , however , no equivalent in WinRT, then I guess if windows store style no need to do the function what "GetModuleFileName" do by the infrastructural design of WinRT ?  If it is not like what I guess , I had to continue to find the alternative solutions.

    My program can not running now so I have no way to verify my guess .




    Friday, April 12, 2013 7:04 AM
  • Hi H,

    All Dlls must ship and install with the app package so you already know where the module is.  Why do you need this API?

    -Jeff


    Jeff Sanders (MSFT)

    Friday, April 12, 2013 12:00 PM
    Moderator
  • Hi Jeff ,

    I'm a freshman for windows store App development .

    I had know it now , thanks for your explain !

    Monday, April 22, 2013 5:36 AM
  • Hi H,

    My pleasure!

    -Jeff


    Jeff Sanders (MSFT)

    Monday, April 22, 2013 11:51 AM
    Moderator