locked
Running a script within a Metro app RRS feed

  • Question

  • I'm currently looking at what might be involved in porting a standard Win32 desktop program to a Metro style app. One of the things the program does is that it takes a snippet of VBScript code entered by the user (representing typically math expressions) and accesses the VBScript engine from within the program (via the COM interfaces IActiveScriptSite etc) to evaluate it. Does anyone know if there is a way to do this from within a Metro style app? It doesn't need to be VBScript. On searching, I've seen some things that suggest the Java interpreter might be accessible, but I haven't yet found anything specific.

    Thanks in advance for any advice.


    • Edited by RobertHF Sunday, March 25, 2012 11:57 AM
    Sunday, March 25, 2012 11:56 AM

Answers

  • Jesse,

    Robert is not trying to communicate between desktop and Metro.

    Robert,

    There is no script engine or script engine interface in the C++ Metro style application model.  You may be able to write a Javascript app and call eval() on the script that the user enters, but then again, I do not know how you could possibly get the result of this without jumping through some hoops (and it sounds like you want to stay in C++ land).

    -Jeff


    Jeff Sanders (MSFT)

    Monday, March 26, 2012 5:52 PM
    Moderator

All replies

  • I'm currently looking at what might be involved in porting a standard Win32 desktop program to a Metro style app. One of the things the program does is that it takes a snippet of VBScript code entered by the user (representing typically math expressions) and accesses the VBScript engine from within the program (via the COM interfaces IActiveScriptSite etc) to evaluate it. Does anyone know if there is a way to do this from within a Metro style app? It doesn't need to be VBScript. On searching, I've seen some things that suggest the Java interpreter might be accessible, but I haven't yet found anything specific.

    Thanks in advance for any advice.

    Sunday, March 25, 2012 11:51 AM
  • Hello,

    There are no supported ways for Metro style apps to communicate with Desktop apps.

    Here are all the Win32 and COM API supported in metro style app.
    http://msdn.microsoft.com/en-us/library/windows/apps/br205762.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 26, 2012 3:10 AM
  • Jesse,

    Robert is not trying to communicate between desktop and Metro.

    Robert,

    There is no script engine or script engine interface in the C++ Metro style application model.  You may be able to write a Javascript app and call eval() on the script that the user enters, but then again, I do not know how you could possibly get the result of this without jumping through some hoops (and it sounds like you want to stay in C++ land).

    -Jeff


    Jeff Sanders (MSFT)

    Monday, March 26, 2012 5:52 PM
    Moderator
  • Jeff, Jesse,

    Thanks for that. I may be able to find the source code for a simple interpreter somewhere and incorporate that into my program.

    Robert

    Monday, March 26, 2012 11:43 PM