locked
Cappuccino in Metro?

    Question

  • UPDATE: It appears that Cappuccino uses some ActiveX controls that are not supported by WWAHost. Just digging deeper to find out what they are...

    I'm trying to get a sample javascript application to run in Metro. The application works in IE and Chrome on the desktop from index.html. I created a new Metro javascript application and copied all the files into the project and set the Start Page in the manifest to index.html. When I try to run the application I get the following errors in the console:

     

    • WWA9603: Cannot load the plug-in that has the class ID '{88D96A0A-F192-11D4-A65F-0040963251E5}'. Windows Web Applications supports a limited set of ActiveX controls.
      File: ms-wwa://54d27f67-197f-4613-b5d6-3f9ed82a5a65-yqdhsn7yvy3k6/index.html
    • WWA9603: Cannot load the plug-in that has the class ID '{F5078F35-C551-11D3-89B9-0000F81FE221}'. Windows Web Applications supports a limited set of ActiveX controls.
      File: ms-wwa://54d27f67-197f-4613-b5d6-3f9ed82a5a65-yqdhsn7yvy3k6/index.html
    • WWA9614: The top level document requested document mode <0> while the Windows Web Application Host is enforcing document mode <10>.
      File: ms-wwa://54d27f67-197f-4613-b5d6-3f9ed82a5a65-yqdhsn7yvy3k6/index.html
    • JavaScript runtime error: Unable to get value of the property 'nodeName': object is null or undefined
      File: ms-wwa://54d27f67-197f-4613-b5d6-3f9ed82a5a65-yqdhsn7yvy3k6/Frameworks/Objective-J/Objective-J.js, line: 1035 column: 9

     

    There should not be a problem in the Objective-J.js since the exact same files work fine in the browser.

    Is there some way I can find out what  class ID '{88D96A0A-F192-11D4-A65F-0040963251E5}' refers to?

    Can anyone point me in the right direction for how to move forward? I've tried researching the errors but nothing relevant has come up. Thanks

     



    • Edited by Ditts Thursday, January 5, 2012 3:02 AM
    Thursday, January 5, 2012 1:22 AM

Answers

  • ActiveX controls in general are not supported in Metro style apps (nor in the Metro style browser, as described here, though they do work in the desktop IE). The few that are allowed are built into Windows and are listed here.

    The CLSIDs you note are (a) XMLHTTP 6.0 contained within Microsoft XML Core Services 6.0 (MSXML6; the CLSID ending in 51e5), and (b) XMLHTTP 3.0 in Core Services 3.0 (CLSID ending in E221). Neither are in the supported list, hence, the errors you're seeing.

    As XMLHTTP is a wrapper on XMLHttpRequest functionality, you'll need to identify the code that utilizes it and rewrite it to use WinJS.xhr instead (docs here). You can also use raw async XHR if you like, but WinJS.xhr is intended to make that simpler. (Don't use synchronous xhr, however, since you never want to block the UI thread in a Metro style app.)

    There are some samples that use XHR. This link has the appropriate query.

    By the way, if you encounter unknown CLSIDs like this, a web search will usually reveal what they are.

    Lastly, if you have other errors with Objective-J.js, know that the DOM API as presented to a Metro style app differs in a number of small ways from the API presented by a browser. Those details are unfortunately hidden down in the HTML/DOM reference rather than being listed in one place (we're fixing that in the next rev of the docs, I believe), but you can cross-check stuff there anyway.

    It's likely that the nodeName error you're seeing is because the script expects that some XML was available in which to look for a node, but because the ActiveX controls we're loaded it got a runtime error.

    .Kraig

    • Marked as answer by Ditts Thursday, January 5, 2012 10:26 PM
    Thursday, January 5, 2012 7:00 AM

All replies

  • ActiveX controls in general are not supported in Metro style apps (nor in the Metro style browser, as described here, though they do work in the desktop IE). The few that are allowed are built into Windows and are listed here.

    The CLSIDs you note are (a) XMLHTTP 6.0 contained within Microsoft XML Core Services 6.0 (MSXML6; the CLSID ending in 51e5), and (b) XMLHTTP 3.0 in Core Services 3.0 (CLSID ending in E221). Neither are in the supported list, hence, the errors you're seeing.

    As XMLHTTP is a wrapper on XMLHttpRequest functionality, you'll need to identify the code that utilizes it and rewrite it to use WinJS.xhr instead (docs here). You can also use raw async XHR if you like, but WinJS.xhr is intended to make that simpler. (Don't use synchronous xhr, however, since you never want to block the UI thread in a Metro style app.)

    There are some samples that use XHR. This link has the appropriate query.

    By the way, if you encounter unknown CLSIDs like this, a web search will usually reveal what they are.

    Lastly, if you have other errors with Objective-J.js, know that the DOM API as presented to a Metro style app differs in a number of small ways from the API presented by a browser. Those details are unfortunately hidden down in the HTML/DOM reference rather than being listed in one place (we're fixing that in the next rev of the docs, I believe), but you can cross-check stuff there anyway.

    It's likely that the nodeName error you're seeing is because the script expects that some XML was available in which to look for a node, but because the ActiveX controls we're loaded it got a runtime error.

    .Kraig

    • Marked as answer by Ditts Thursday, January 5, 2012 10:26 PM
    Thursday, January 5, 2012 7:00 AM
  • I don't get it. What's the difference between a "metro html5 app/page" using a winRT component (which is nothing but some kind of plugin) and a COM component/API that a desktop app has exposed, and which i now want to use to dish up a metro app????

    More importantly, given this COM API, can i at all write a metro app in javascript, howsoever?? How?? What do i need to doooooo?????

    Thursday, January 12, 2012 8:21 PM
  • Hi Vxxxx,

    I am not really sure what you are asking.  You can create a WinMD component, include and use it in your project.  You cannot create your own COM component or use another one however.  See the links in Kraig's answer above for more information.

    -Jeff


    Jeff Sanders (MSFT)
    Friday, January 13, 2012 1:49 PM
    Moderator
  • My question is this.

    I have a COM object,say with a progID "Foo.bar".

    I can't do in javascript (as now seems clear) for WWAHost.exe, the metro app -

    var myfoo = new ActiveXObject("Foo.Bar"); // create and use foo.bar from javascript.

    fair enough. But Foo.Bar is where my functionality lies. I need to use it. Don't tell me to rewrite the whole thing for whatever. I am ready to wrap it,but i just need to know how to get started. The ultimate objective is to have it be usable for getting/setting from html5/js metro app.

    As i was exploring, it seems there are issues if i do a #import "foo.dll" in a winRTComponent C++/CX project. Weird things,like IErrorInfo grayed out because of conflicting definitions. (this is just an aside,i am looking for a sample or something,that will help me get started on the above)

    Friday, January 13, 2012 3:14 PM
  • Hi V,

    You can wrap your functionality in a WinMD object as long as your component uses only interfaces compatible with WinRT.  Some interfaces are not available due to the security sandboxing model that Metro style apps provide for you.  For example if your component is making a win32 api call that is not allowed, your app will not pass the Windows App Certification Kit (installed in the Developer Preview).

    This example should help you understand the process better: http://msdn.microsoft.com/en-us/library/windows/apps/hh441589(v=vs.110).aspx.  Note that you can include your WinMD component directly in your application rather than deploy it as a VSIX.

    There are some samples on creating a WinMD component:

    Groove Drum Sequencer - HTML/JS and WinRT C++

    Hybrid JavaScript and C++ Sample

    -Jeff

     

     


    Jeff Sanders (MSFT)
    Friday, January 13, 2012 3:51 PM
    Moderator