Jun 092014
 
 June 9, 2014  Posted by at 3:06 pm C# & F#, Universal Apps, Windows, WinRT  Add comments

Brokered components were introduced at BUILD 2014 and allows us to make use of legacy DLLs without much problems (heh). The VS templates came out aprox a month after BUILD, and before that there was a fair deal of manual work involved, I tried it and it was a pain. However, the templates make it rather easy, or easier.

Here is a step by step video with some rambling, which is what you get when your record demos at midnight after a week with very little sleep.

The best example I could come to think of, and I don’t even know if this is the best example, is simply using the file watcher and output changes to a directory in the Windows Store App.

The way it works is that the brokered component allows us to use any DLL (more or less), which means that the Store app won’t be able to use it directly as there is a missmatch between the platforms they are built for.

This is solved by creating a proxy that in turn can reference the component and allow the Store application to call the component.

The Store application has to add an extension in the manifest and register the proxy DLL as well as classes that it will be using, and the DLL has to be registered.

Steps:

Install VS extension

2014-06-09_23-55-38

Create Store app

<No image you should know how to do this>

Create  Brokered Component – do magic in it

2014-06-09_23-55-52

Create Proxy – add reference to component (right click, properties, common properties, add reference)

2014-06-09_23-56-09

 

2014-06-09_23-56-23

Add reference to proxy from Store app

2014-06-09_23-56-38

Build solution

Add Extension in Store manifest file, register class and add path to Proxy DLL

2014-06-09_23-57-14

Run regsvr32 from elevated prompt and path to proxy DLL

2014-06-09_23-57-50

Run and have fun.

2014-06-09_23-12-18

Some more links:

Brokered components in detail

http://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx

VS extension

http://visualstudiogallery.msdn.microsoft.com/527286e4-b06a-4234-adde-d313c9c3c23e

BUILD

http://channel9.msdn.com/Events/Build/2014/2-515video

BUILD video demo

http://channel9.msdn.com/blogs/HarryPierson/Brokered-WinRT-Components-Wake-On-Callback-Demo

Detailed step by step by awesome Harry

http://devhawk.net/2014/04/25/brokered-winrt-components-step-one/

Harry Pierson on Twitter

https://twitter.com/DevHawk

 

 

 

 

 

 

 

One comment on “Creating and using brokered components step by step video

  1. Matthew Lawson on said:

    Hey,

    (Maybe a stupid question) I might just be confusing the name WinRT to ARM devices instead of the actual “runtime”. Does this only apply to WinRT (ARM) devices or can I use the same thing with writing x64 Windows Store Apps?

    Regards,
    Matt

Leave a Reply

Your email address will not be published. Required fields are marked *

*

HTML tags are not allowed.

What is 9 + 3 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)