<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Platformability &#187; StreamLink</title>
	<atom:link href="http://blog.caplin.com/tag/streamlink/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.caplin.com</link>
	<description>Single Dealer Platforms, Industry Expertise</description>
	<lastBuildDate>Fri, 03 Feb 2012 15:38:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Would anybody want StreamLink for Windows Mobile?</title>
		<link>http://blog.caplin.com/2009/12/30/would-anybody-want-streamlink-for-windows-mobile/</link>
		<comments>http://blog.caplin.com/2009/12/30/would-anybody-want-streamlink-for-windows-mobile/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 12:04:07 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[StreamLink]]></category>
		<category><![CDATA[StreamLink.NET]]></category>
		<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=929</guid>
		<description><![CDATA[After years of promise it really does look like mobile is the next big thing? But what mobile platform will prove to be the most popular? It seems to be a two horse race between iPhone and Android, with Windows Mobile lagging somewhere in the distance &#8211; or is it...]]></description>
			<content:encoded><![CDATA[<p>After years of promise it really does look like mobile is the next big thing? But what mobile platform will prove to be the most popular? It seems to be a two horse race between iPhone and Android, with Windows Mobile lagging somewhere in the distance &#8211; or is it already a non-runner? In any case it&#8217;s been <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aXJlZC5jb20vZ2FkZ2V0bGFiLzIwMDkvMTIvd2luZG93cy1tb2JpbGUtNy1kZWxheWVkLXVudGlsLWxhdGUtMjAxMC8=">delayed until late 2010</a>.</p>
<p><span id="more-929"></span></p>
<div id="attachment_931" class="wp-caption alignnone" style="width: 330px"><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS93cC1jb250ZW50L3VwbG9hZHMvd2luZG93cy1tb2JpbGUtNy10aGVtZS1zbWFydHBob25lLmpwZw=="><img class="size-full wp-image-931" title="Windows Mobile 7" src="http://blog.caplin.com/wp-content/uploads/windows-mobile-7-theme-smartphone.jpg" alt="" width="320" height="240" /></a><p class="wp-caption-text">Windows Mobile 7</p></div>
<p>At work the concensus amongst the developers at Caplin seems to be that they like Android as a platform and there&#8217;s quite a bit of excitement about the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aXJlZC5jb20vZ2FkZ2V0bGFiLzIwMDkvMTIvbmV3LWdvb2dsZS1uZXh1cy1vbmUtcGhvbmUtbGlrZWx5LXRvLWxhdW5jaC1qYW4tNS8=">Google Nexus One which will contain the Android 2.1 operating system</a>.</p>
<div class="wp-caption alignnone" style="width: 324px"><img class=" " title="Nexus Google One Phone" src="http://images.trustedreviews.com/images/article/inline/12461-12399image.jpg" alt="" width="314" height="263" /><p class="wp-caption-text">Nexus Google One Phone</p></div>
<p>Since I&#8217;ve been involved in most of the Microsoft product development here I&#8217;m interested to see if there is any chance of Windows Mobile doing anything. I&#8217;m excited about the inclusion of <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53bWV4cGVydHMuY29tL3NpbHZlcmxpZ2h0LW1vYmlsZS1ydW1vcmVkLXdpbmRvd3MtbW9iaWxlLTY1">Silverlight in Windows Mobile 7</a>, as I <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDA5LzA4LzA0L3N0cmVhbWxpbmstZm9yLXNpbHZlcmxpZ2h0LWZvci1tb2JpbGUv">blogged about</a> some time back, and have just read a small piece that indicates Microsoft are keen to take gaming mobile with <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ldGlvbGUuY29tLzIwMDkvMTIvd2luZG93cy1tb2JpbGUteGJveC1saXZlLWdhbWluZy1wbGF0Zm9ybS1mb3Itd2luZG93cy1tb2JpbGUv">XBox 360 integration</a>.</p>
<p><!--more--></p>
<p>A while back, just after we&#8217;d ported StreamLink.NET to the Silverlight runtime, I took an R&amp;D day to try to port StreamLink.NET to Windows Mobile. I made good progress but left things in a non-compiling state. More recently I had another opportunity to take a day to try and finish the work off. The codebase had moved slightly so I had to do a little more work that I&#8217;d planned and now I&#8217;m left with a single compilation error based around the .NET Compact Framework not having the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbS9lbi11cy9saWJyYXJ5L3N5c3RlbS50aHJlYWRpbmcud2FpdGhhbmRsZS53YWl0YW55LmFzcHg=">WaitHandle.WaitAny</a> method. To resolve this I&#8217;m going to have to <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2N1cmlvdXNtaW5kcy53b3JkcHJlc3MuY29tLzIwMDYvMTEvMjAvd2FpdGluZy1mb3Itd2FpdGFueS8=">go native</a> or we may have to consider purchasing the fantastic <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5vcGVubmV0Y2YuY29tL1Byb2R1Y3RzL1NtYXJ0RGV2aWNlRnJhbWV3b3JrL3RhYmlkLzY1L0RlZmF1bHQuYXNweA==">Smart Device Framework</a>.</p>
<p>If Windows Mobile 7 supports Silverlight then maybe you could argue that my time spent porting StreamLink.NET to Windows Mobile has been wasted? Or, maybe you would argue that any time spent developing for the Windows Mobile platform is a waste of time? Personally, I like Windows Mobile as a platform, I have a Windows Mobile phone and I think the Windows Mobile development experience in Visual Studio is second to none. For these reasons, and because competition can lead to improved products, I hope Windows Mobile 7 makes a challenge in the final furlongs of the mobile platform race.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=929" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2009/12/30/would-anybody-want-streamlink-for-windows-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling Flex for enterprise applications</title>
		<link>http://blog.caplin.com/2009/10/22/scaling-flex-for-enterprise-applications/</link>
		<comments>http://blog.caplin.com/2009/10/22/scaling-flex-for-enterprise-applications/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 15:32:37 +0000</pubDate>
		<dc:creator>Martin Tyler</dc:creator>
				<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[StreamLink]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=482</guid>
		<description><![CDATA[Last night Phil Leggetter and I attended a session on Scaling Flex applications run by Skillsmatter. The video of the event has now been posted. We found this interesting as we as a company have entered the world of Flex. Our product is a Flex library API, which is part of our Caplin...]]></description>
			<content:encoded><![CDATA[<p>Last night <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS9hdXRob3IvcGhpbGxjYXBsaW5jb20v">Phil Leggetter</a> and I attended a session on <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NraWxsc21hdHRlci5jb20vcG9kY2FzdC9hamF4LXJpYS9tYXRyaXg=">Scaling Flex applications</a> run by <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NraWxsc21hdHRlci5jb20v">Skillsmatter</a>. The video of the event has now been <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NraWxsc21hdHRlci5jb20vcG9kY2FzdC9hamF4LXJpYS9tYXRyaXg=">posted</a>.</p>
<p>We found this interesting as we as a company have entered the world of <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hZG9iZS5jb20vcHJvZHVjdHMvZmxleC8=">Flex</a>. Our product is a Flex library API, which is part of our <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jYXBsaW4uY29tL2NhcGxpbi14YXF1YS5waHA=">Caplin Xaqua</a> offering, whereas the session discussed creating a Flex GUI application. It was good to see that there are a number of powerful Flex application frameworks and that they could easily be leveraged to use our library. The talk covered frameworks, modularisation techniques and tools that have been used by <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2xhYjQ5LmNvbS8=">Lab49</a> in the various Flex projects they have been involved in.</p>
<p><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ib3JyZXdlc3NlbC5jb20v">Borre Wessell</a> of Lab49, who gave the talk, also covered their agile development process, which sounds fairly similar to ours even though they do more consultancy and we do a mix of consultancy and product work.</p>
<p>It was also interesting that Borre recommended using <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2xhYnMuYWRvYmUuY29tL3RlY2hub2xvZ2llcy9mbGFzaGJ1aWxkZXI0Lw==">Flash Builder 4</a> beta as we also found that was better with its integrated unit testing and <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hZG9iZS5jb20vZGV2bmV0L2ZsZXgvYXJ0aWNsZXMvZmxhc2hidWlsZGVyNF93aGF0c25ldy5odG1s">other productivity enhancements</a>. Tool support does seem a bit lacking in some areas for Flex &#8211; whilst there is a memory profiler as part of Flash Builder 4 the performance testing seems to be very much a manual process. We prefer to have performance tests as part of our automated processes so you can catch any regressions as early as possible.</p>
<p>Next week I will post my followup to my previous <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDA5LzEwLzIwL2FwcHJvYWNoZXMtdG8tc3RyZWFtaW5nLw==">post about streaming technologies</a>, which will touch on the LCDS approach compared to Caplin&#8217;s methods.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=482" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2009/10/22/scaling-flex-for-enterprise-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Streamlink for Silverlight for Mobile</title>
		<link>http://blog.caplin.com/2009/08/04/streamlink-for-silverlight-for-mobile/</link>
		<comments>http://blog.caplin.com/2009/08/04/streamlink-for-silverlight-for-mobile/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 16:10:16 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Comet]]></category>
		<category><![CDATA[Financial Ajax]]></category>
		<category><![CDATA[Real-time web]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[StreamLink]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=331</guid>
		<description><![CDATA[With the recent release of Caplin&#8217;s Streamlink for Silverlight it&#8217;s exciting to find out that Microsoft plan to release a Silverlight for Mobile devices. The goal of Silverlight is to provide a consistent experience across desktop and mobile phones. Developers will be able to easily optimize Silverlight applications for mobile...]]></description>
			<content:encoded><![CDATA[<p>With the recent release of Caplin&#8217;s Streamlink for Silverlight it&#8217;s exciting to find out that Microsoft plan to release a <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NpbHZlcmxpZ2h0Lm5ldC9sZWFybi9tb2JpbGUuYXNweA==">Silverlight for Mobile devices</a>.</p>
<blockquote cite="http://silverlight.net/learn/mobile.aspx"><p>The goal of Silverlight is to provide a consistent experience across desktop and mobile phones. Developers will be able to easily optimize Silverlight applications for mobile form factors or run existing Silverlight applications on mobile phones.</p></blockquote>
<p>The great thing about this release is that any existing Silverlight applications should work on any mobile device with Silverlight installed. The question about this is that if you design a user interface for a desktop browser how will it fit on a windows mobile browser? Well, Microsoft plan to give developers the ability to &#8220;optimize Silverlight applications for mobile form factors&#8221; which sounds like they will give us a way of dealing with the obvious UI differences between desktop and mobile platforms, as well as the underlying runtime issues.</p>
<p>We&#8217;ve already blogged about what impact <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDA5LzA2LzA5L3NpbHZlcmxpZ2h0LWZvci1zaW5nbGUtZGVhbGVyLXBvcnRhbHMv">Silverlight may have on single dealer portals</a>. I&#8217;m really excited to see what developers can do using StreamLink for Silverlight to enable the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDA5LzA0LzIwL3doYXQtaXMtdGhlLXJlYWwtdGltZS13ZWIv">real-time web</a> on a windows mobile device. What opportunities might Streamlink for Silverlight Mobile enable?</p>
<div class="wp-caption alignnone" style="width: 290px"><img title="Microsoft Silverlight" src="http://i16.photobucket.com/albums/b12/al_oasis1/microsoft_silverlight.jpg" alt="Silverlight for Mobile" width="280" height="312" /><p class="wp-caption-text">Silverlight for Mobile</p></div>
<p>Read the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NpbHZlcmxpZ2h0Lm5ldC9sZWFybi9tb2JpbGUuYXNweA==">Silverlight for Mobile FAQ</a> for more information.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=331" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2009/08/04/streamlink-for-silverlight-for-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting realtime data into Excel</title>
		<link>http://blog.caplin.com/2009/06/30/getting-realtime-data-into-excel/</link>
		<comments>http://blog.caplin.com/2009/06/30/getting-realtime-data-into-excel/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 17:00:54 +0000</pubDate>
		<dc:creator>Dom</dc:creator>
				<category><![CDATA[Real-time web]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[RTD]]></category>
		<category><![CDATA[StreamLink]]></category>
		<category><![CDATA[StreamLink.NET]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=261</guid>
		<description><![CDATA[Starting with Excel 2002, Microsoft have included the RTD interface which allows Excel to poll for data. Polling seems to be a much more efficient way of getting data into Excel than the classic approach which is pushing &#8211; it&#8217;s not uncommon to find yourself pushing when Excel isn&#8217;t ready...]]></description>
			<content:encoded><![CDATA[<p>Starting with Excel 2002, Microsoft have included the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbS9lbi11cy9saWJyYXJ5L21pY3Jvc29mdC5vZmZpY2UuaW50ZXJvcC5leGNlbC5ydGQob2ZmaWNlLjExKS5hc3B4">RTD interface</a> which allows Excel to poll for data. Polling seems to be a much more efficient way of getting data into Excel than the classic approach which is pushing &#8211; it&#8217;s not uncommon to find yourself pushing when Excel isn&#8217;t ready which results in lockups, inconstitencies and other undesirable effects.</p>
<p>The RTD interface is small (6 methods) and Kenny Kerr has a great series of articles about RTD on his <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2h0dHA6Ly93ZWJsb2dzLmFzcC5uZXQva2VubnlrZXJyL2FyY2hpdmUvMjAwOC8xMS8xMy9SdGQzLmFzcHg=">blog</a> so I won&#8217;t repeat that information here and instead concentrate on integration to StreamLink.NET and pulling in real time data from a Caplin platform deployment.</p>
<p>The following walkthrough is a short example of how to do this, there&#8217;s no error checking, logging and certainly the example is nowhere near production quality, however it does demonstrate that linking up Excel and data from the Liberator is straightforward.</p>
<p><span id="more-261"></span></p>
<p><strong>ServerStart</strong> is the entry point and in here we can instantiate StreamLink.NET and setup a map between the RTD topic ids and the Subject/Field information.</p>
<pre name="code" class="c#">    public int ServerStart(IRTDUpdateEvent callback)
    {
        sl = new StreamLinkInterop();
        m_callback = callback;
        m_timer = new Timer();
        m_timer.Tick += new EventHandler(TimerEventHandler);
        m_timer.Interval = 1000;
        m_topics = new Dictionary&lt;int, KeyValuePair&lt;string,string&gt;&gt;();
        return 1;
    }</pre>
<p>The <strong>ConnectData</strong> method validates the arguments passed through and then attempts to subscribe to the data:</p>
<pre name="code" class="c#">public object ConnectData(int topicId,
                              ref Array strings,
                              ref bool newValues)
    {
        if (2 != strings.Length)
        {
            return "Subject and field is required";
        }

        string subject = strings.GetValue(0).ToString();
        string field = strings.GetValue(1).ToString();

        m_topics[topicId] = new KeyValuePair(subject, field);
        m_timer.Start();
        sl.Subscribe(subject, field);
        return "NO_DATA_YET";
    }</pre>
<p>And <strong>DisconnectData</strong> will unsubscribe:</p>
<pre  name="code" class="c#" >    public void DisconnectData(int topicId)
    {
        KeyValuePair pair = m_topics[topicId];

        sl.Unsubscribe(pair.Key, pair.Value);
        m_topics.Remove(topicId);
    }</pre>
<p><strong>RefreshData</strong> will retrieve the current image for the subscribed data:</p>
<pre name="code" class="c#">    public Array RefreshData(ref int topicCount)
    {
        object[,] data = new object[2, m_topics.Count];

        int index = 0;

        foreach (int topicId in m_topics.Keys)
        {
            data[0, index] = topicId;
            KeyValuePair pair = m_topics[topicId];
            data[1, index] = sl.GetData(pair.Key, pair.Value);

            ++index;
        }

        topicCount = m_topics.Count;

        m_timer.Start();
        return data;
    }</pre>
<p>Because Excel polls for the data we&#8217;ve got to have a cache within our RTD server so that data is available when Excel calls in, for the purposes of this exercise we&#8217;re only considering Record data without market depth or history so our cache can be really simple:</p>
<pre name="code"  class="c#">    public class RecordType1Cache
    {
        Dictionary fieldMap = new Dictionary();

        public RecordType1Cache()
        {
        }

        public void Update(IRecordEvent evt)
        {
            foreach ( IField field in evt.Fields.Values )
            {
                fieldMap[field.Name] = field.Value;
            }
        }

        public string GetFieldValue(string fieldName)
        {
            if (fieldMap.ContainsKey(fieldName))
            {
                return fieldMap[fieldName];
            }
            return "NO_FIELD_AVAILABLE";
        }
    }</pre>
<p>The only missing part is the <strong>StreamLinkInterop</strong> class which integrates with StreamLink, this needs to implement the public methods we saw earlier: <strong>Subscribe</strong>, <strong>Unsubscribe</strong> and <strong>GetData</strong> as well as the <strong>IRecordSubscriptionListener</strong> interface from StreamLink.NET since we want to receive record updates. When an update is received we put it into our cache and return immediately.</p>
<p>There&#8217;s a couple of maps which allows finding the <strong>RecordType1Cache</strong> object from both the StreamLink side (using the <strong>IRecordSubscription</strong> as the key) and from the RTD side (using a subscription name as the key).</p>
<p>The connection to the server is setup in the constructor for code simplification purposes. The servername is hard coded so you&#8217;ll probably need to change it or find a way to configure it if you use this code as a base for your own project.</p>
<pre name="code" class="c#">    public class StreamLinkInterop : IRecordSubscriptionListener
   {
        StreamLink myStreamLink;
        Dictionary cache = new Dictionary();
        Dictionary subscriptionLookup = new Dictionary();

        public StreamLinkInterop()
        {
            IStreamLinkConfiguration config = SimpleConfiguration.CreateType2Connection("liberator", 8080);
            myStreamLink = new StreamLink(config);
            myStreamLink.CredentialsProvider = new PasswordCredentialsProvider("admin", "admin");
            myStreamLink.StreamLinkProvider.Connect();
        }

        public void Terminate()
        {
            myStreamLink.StreamLinkProvider.Disconnect();
        }

        public void Subscribe(string subject, string field)
        {
            string name = subject + ";" + field;

            IRecordSubscriptionParameters rparams = myStreamLink.StreamLinkProvider.ParametersFactory.CreateRecordSubscriptionParameters(new string[] { field } );
            ISubscription sub = myStreamLink.StreamLinkProvider.CreateRecordSubscription(this, subject , rparams);

            cache[sub] = new RecordType1Cache();
            subscriptionLookup[name] = sub;
            sub.Subscribe();
        }

        public void Unsubscribe(string subject, string field)
        {
            string name = subject + ";" + field;

            if (subscriptionLookup.ContainsKey(name))
            {
                ISubscription sub = subscriptionLookup[name];
                sub.Unsubscribe();
                cache.Remove(sub);
                subscriptionLookup.Remove(name);
            }
        }
       public string GetData(string subject, string field)
        {
            string name = subject + ";" + field;
            if (subscriptionLookup.ContainsKey(name))
            {
                ISubscription sub = subscriptionLookup[name];
                return cache[sub].GetFieldValue(field);
            }
            return "UNKNOWN+SUBJECT";
        }

        #region IRecordSubscriptionListener Members

        public void RecordType2Updated(Caplin.StreamLink.Subscription.ISubscription subscription, IRecordType2Event ev)
        {
        }

        public void RecordType3Updated(Caplin.StreamLink.Subscription.ISubscription subscription, IRecordType3Event ev)
        {
        }

        public void RecordUpdated(Caplin.StreamLink.Subscription.ISubscription subscription, IRecordEvent ev)
        {
            if (cache.ContainsKey(subscription))
            {
                cache[subscription].Update(ev);
            }
        }

        #endregion

        #region ISubscriptionListener Members

        public void SubscriptionErrorReceived(Caplin.StreamLink.Subscription.ISubscription subscription, Caplin.StreamLink.Subscription.ISubscriptionErrorEvent ev)
        {
        }

        public void SubscriptionStatusUpdated(Caplin.StreamLink.Subscription.ISubscription subscription, Caplin.StreamLink.Subscription.ISubscriptionStatusEvent ev)
        {
        }

        #endregion
    }</pre>
<p>To pull data into excel into excel use a formula along the following lines: <code>=RTD("com.caplin.excel",,"/I/MSFT.O", "BID")</code>. The data in the cell will update periodically (by default every 2000ms). This period can be changed using either a registry setting or using VBA, details can be found at <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbS9lbi11cy9saWJyYXJ5L2FhMTQwMDYwKG9mZmljZS4xMCkuYXNweCNvZGNfeGxydGRmYXFfaG93Y29uZmlncnRkdGhyb3R0bGU=">MSDN</a>.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=261" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2009/06/30/getting-realtime-data-into-excel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

