locked
Can Winrt component be written in javascript

    Question

  • I had a library in js file and checking if I can convert it to a winrt component. Is it possible to write winrt components in javascript?


    -sushil

    Tuesday, January 8, 2013 5:24 AM

Answers

  • Hi,

    You can't Create Windows Runtime Components with JavaScript. By using the Windows Runtime, you can create components (essentially DLLs) in C++, C#, or Visual Basic, and call into them in a simple and natural way from a Windows Store app that's built by using JavaScript. Although you can use JavaScript to access the Windows Runtime APIs, JavaScript cannot easily access native C++ libraries or .NET Framework class library functionality. For example, you might create a component in C++ that uses a third-party library to perform some computationally expensive operations. Or you might want to reuse some Visual Basic or C# code in your Windows Store app built for Windows using JavaScript. In either case, you can use the language of your choice to wrap that functionality in a Windows Runtime Component. Visual Studio features can help you create the component project and reference it from JavaScript.

    I think you can save the js file like a js library. And just refer that in the page.


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Monday, January 14, 2013 10:58 AM
    Tuesday, January 8, 2013 7:12 AM