Marcus MacWilliam
Marcus MacWilliam

Reputation: 612

I need a Windows 8 WinRT application to communicate with a standalone application written in C

I have 2 application running on the same machine.

  1. Editor, is a Windows 8 application developed with WinRT and is sand-boxed. (Client)

  2. Integrator is a C++ application for reading hardware devices over serial COM ports. (Server)

I have done a lot of searches about how to get client/server communication to work on Windows 8, and can only find posts that say it is not possible using standard WinRT classes, etc.

What I need is a solution where by the Windows 8 application works as a client, and the standalone executable works as a server.

Can someone please suggest a mechanism that can be used to do client/server communication.

If we cannot find a good solution for this, then we will have to resort to using files, which I would rather not have to do.

Clarification: I am aware of the many mechanism that can be used to do client/server communication. What I am looking for is a workaround to the problem, where the these techniques will not work on a Windows 8 application, developed with WinRT. As the sand-boxing explicitly prohibits the client and server being on the same host machine.

Upvotes: 0

Views: 217

Answers (1)

Damir Arh
Damir Arh

Reputation: 17865

Well, the posts stating that such communication is not possible, are mostly right. There are 2 reasons, why this is prevented:

  1. Being able to communicate to an application outside the sandbox effectively breaks the sandbox. The Windows Store app is now suddenly able to do everything the desktop application can do: access file system, registry... Windows Store apps live in a sandbox for reason - to be safe for the user.
  2. The Windows Store app won't work after it is installed from the the store or from a package. It needs to have a desktop application installed and set up correctly as well.

I would suggest you try to move your server part to a different machine and make it a proper server. If for some reason you really can't do that, you still have the following options available:

  • You can use TCP/IP to connect local network resources if you remove the isolation for your Windows Store app. You will need to use CheckNetIsolation.exe, but since you already need to separately install the desktop application, this shouldn't be that much of a problem.
  • You can create files with a specific extension. Then register the desktop app for one extension and the Windows Store app for another extension. You can now shell execute files with these extensions to use them as a message for the other app.

Upvotes: 1

Related Questions