This is a mirror of official site: http://jasper-net.blogspot.com/

Host Silverlight Control in C++ using ATL

| Thursday, May 20, 2010
This article explains that how we can host MS Silverlight Control in a C++ application using ATL/WTL without using the browser (IE/FF).

Mostly people think that Silverlight control can't be used in C++ application. In this article, we will walk through hosting a silverlight control and loading silverlight contents (.xap) file in it.

Using this approach, we can write desktop based applications using Silverlight (without using IE/FF) and distribute it. By using MS Silverlight runtime which is very light weight as compared to .NET framework.

Why do we need to host the Silverlight Control in C++ application? why don't we use WPF right a way? This approach gives you a way to make your desktop application with a Silverlight User Interface and without using the complete .NET framework.. We only need Silverlight runtime.

I am using Silverlight 4.0 for this sample.

COM Reference:

Microsoft provides COM reference for silverlight control. Please take a look at this URL http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx.

Create an ATL Application:

Create an ATL out-of-process(executable) project. I used "AtlProject" name is my sample.

Step:1

Implement IXcpControlHost2 Interface.

Open AtlProject.idl file and use following .idl file in order to implement IXcpControlHost to host the Silverlight ActiveX control. This .idl is provided by Microsoft.


Read more: Codeproject

Posted via email from jasper22's posterous

0 comments: