locked
Could I create a MFC DLL for Metro apps to use?

    Question

  • I am using VS2012 pro on Win8 Pro. I encountered an issue and needs your help:

    Let me simplify the scenario: Metro App (JavaScript) calls DLL1(a Windows Runtime Component), and DLL1 calls DLL2(a MFC DLL).

    After I created a MFC DLL, then from "Configuration Properties", I changed the "use of MFC" as "Use Standard Windows Libraries", and changed "Windows Store App Support" as "Yes". Only a very simple function with empty body is implemented. But My Metro App always said that "0x8007007e - JavaScript runtime error: The specified module could not be found." After debugging, I found that the error is caused by DLL2. But I don't know why it is caused.

    Does anybody know anything about this? Or would you please give me some hint?

    Thanks.


    • Edited by B0L Saturday, January 5, 2013 6:37 AM
    Saturday, January 5, 2013 6:26 AM

Answers

  • This is my solution: all external dependent dll (not the system dll but built by yourself or others) must be must manually added into the js project by "added as link". Thus the issue could be resolved. If any encounter the same issue, please write to me and let's discuss it. Thanks.
    • Marked as answer by B0L Sunday, May 5, 2013 8:50 AM
    • Edited by B0L Sunday, May 5, 2013 8:51 AM
    Sunday, May 5, 2013 8:50 AM

All replies

  • After carefully check, I found that I missed one library. But JavaScript didn't give me any more concrete detail...Thank you all.
    • Marked as answer by B0L Saturday, January 5, 2013 12:07 PM
    • Unmarked as answer by B0L Sunday, May 5, 2013 8:50 AM
    Saturday, January 5, 2013 12:07 PM
  • Note that your MFC DLL probably is not valid for a Windows Store app and will not pass certification, although the settings you flipped may have fixed this (I'm not sure it's still really an MFC DLL at that point). Run your project through the Windows App Cert Kit to make sure it can pass before you spend a lot of time with that DLL.

    --Rob

    Saturday, January 5, 2013 7:03 PM
    Moderator
  • Hi BordenL,

    In addition, when you developing windows runtime library (via .NET managed or C++ native code) and use it in javascript windows store app, you can also choose the "native" debugger so that you can step through or into native code.

    #How to start a debugging session (JavaScript)
    http://msdn.microsoft.com/en-us/library/windows/apps/hh771032.aspx

    Currently, when you start debuging or manualy attach the app process in Visual studio, you can only choose either javascript code or native code exclusively (cannot debug both of them at the same time).


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by hcchien Monday, May 20, 2013 8:53 AM
    Monday, January 7, 2013 6:56 AM
    Moderator
  • This is my solution: all external dependent dll (not the system dll but built by yourself or others) must be must manually added into the js project by "added as link". Thus the issue could be resolved. If any encounter the same issue, please write to me and let's discuss it. Thanks.
    • Marked as answer by B0L Sunday, May 5, 2013 8:50 AM
    • Edited by B0L Sunday, May 5, 2013 8:51 AM
    Sunday, May 5, 2013 8:50 AM