locked
How to create Metro style's services?

    Question

  • How to create Metro style's services?

    Can I Create services in Metro style?

    thanks!



    Thursday, November 17, 2011 9:03 AM

Answers

All replies

  • Metro is intended as a client dev platform. It's not meant to be used to host services consumed by external callers.
    http://blog.voidnish.com
    Thursday, November 17, 2011 3:01 PM
  • You do not understand what I mean. My mean is like this:

    Friday, November 18, 2011 2:29 AM
  • Windows Services cannot be written as Metro style apps.  Windows services cannot be interactive and do not have a UI.  Metro style apps are inherently interactive.

    --Rob

    • Marked as answer by hot_blood2001 Thursday, November 24, 2011 1:40 AM
    Friday, November 18, 2011 2:54 AM
    Owner
  • So, Win32's service can interactive with metro style app?

    thanks!

    Friday, November 18, 2011 3:40 AM
  • http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/0005b94f-8409-4804-88c5-e2f5fcce460a

     

    http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/895cf468-31e0-4e2f-aab1-ae90933610d1

     

    These may help you. Don't care this is a Win32 desktop app or a win32 service, you just want to communication between Metro Apps and Desktop Apps?

    Friday, November 18, 2011 7:14 AM
  • So, Win32's service can interactive with metro style app?

    thanks!


    As of the dev-preview this is still in doubt. Metro apps are sandboxed and are not expected to comunicate with the local machine (desktop apps, local socket services, Windows services etc.) This may or may not change in future but to be safe it's best to assume for the moment that you cannot depend on this.
    http://blog.voidnish.com
    Friday, November 18, 2011 12:47 PM
  • Metro style apps cannot interact with services.  Please see John Hazen's comments in the thread: Interaction between Metro style and non-Metro style applications.

    --Rob

    • Marked as answer by hot_blood2001 Thursday, November 24, 2011 1:40 AM
    Friday, November 18, 2011 10:47 PM
    Owner
  • We can do IPC between Win32 application and Metro application. Waht's the different from a service?

    Monday, November 21, 2011 9:11 AM
  • We can do IPC between Win32 application and Metro application. Waht's the different from a service?


    As far as I know, that's not an officially supported scenario. It may work with the dev preview, but there's no guarantee that it will continue to do so in later releases.
    http://blog.voidnish.com
    Monday, November 21, 2011 12:57 PM
  • What about with a custom WinRT component (not considering the store implications) that interfaces with IPC mechanism of your choice and acts as a proxy for the metro app to that desktop service interface?
    Friday, November 25, 2011 6:58 AM
  • The custom WinRT component I assume would be packaged along with your app, and therefore would  be considered a part of your Metro style app for all practical purposes.
    Raman Sharma | Program Manager, Visual C++ | @rasharm_msft

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)
    Friday, November 25, 2011 7:35 AM
  • Raman, 

    Yes, you assumption is correct, is my assumption that a WinRT component could interface with a legacy desktop service using Win32 COM APIs for instance correct? Suppose we had this situation and we had a long running task that was started by the WinRT component that did not fit nicely into the async background task for metro apps pattern so it was running on a worker thread or in a thread pool created via the Win32 API. When that thread completes we would like fire an event using the delegate / event pattern defined in the custom WinRT component, it cannot be done from the worker thread since the WinRT component is running in what appears to be a different context/apartment...is there a way to marshal the WinRT interface to the worker thread so it can use the interface to raise an event from the worker thread?

    Thanks 

    Saturday, November 26, 2011 5:32 PM
  • If you try and access a COM object housed in a Win32 service from a Metro app or runtime component you will get a class not registered error even if it is and you can do exactly this from a desktop app. So the bottom line is that you cannot do this with the current architecture. You would need a broker object that would allow this pattern and third party developers do not have the ability to create these.
    • Edited by sb123123 Thursday, December 01, 2011 11:56 PM
    • Proposed as answer by sb123123 Thursday, December 01, 2011 11:56 PM
    Thursday, December 01, 2011 11:54 PM