Answered by:
Running a script within a Metro app

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)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, March 26, 2012 5:52 PM
- Marked as answer by Jie Bao Tuesday, April 10, 2012 7:06 AM
Monday, March 26, 2012 5:52 PMModerator
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.
- Merged by Robin_YangModerator Monday, March 26, 2012 9:42 AM duplicate
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.aspxBest regards,
JesseJesse 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)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, March 26, 2012 5:52 PM
- Marked as answer by Jie Bao Tuesday, April 10, 2012 7:06 AM
Monday, March 26, 2012 5:52 PMModerator -
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