<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Paul Mrozowski's Blog - Visual Studio SDK</title>
    <link>http://www.rcs-solutions.com/blog/</link>
    <description>A day in the life (of a developer)</description>
    <language>en-us</language>
    <copyright>Paul Mrozowski / RCS Solutions, Inc.</copyright>
    <lastBuildDate>Tue, 20 Nov 2007 03:28:20 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>paulm@rcs-solutions.com</managingEditor>
    <webMaster>paulm@rcs-solutions.com</webMaster>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=c8672676-2e56-4b2d-8571-6dbe84a4f917</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,c8672676-2e56-4b2d-8571-6dbe84a4f917.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,c8672676-2e56-4b2d-8571-6dbe84a4f917.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c8672676-2e56-4b2d-8571-6dbe84a4f917</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I thought it might be fun to convert an old VFP app. I wrote when I was playing around
with web services inside of VFP to work inside of Visual Studio. It was a simple program
which connected to a webservice which serves up a new Dilbert comic every day, then
it displays it in the VFP desktop. I've been thinking about doing it for a while -
my initial thought was to modify and/or customize the RSS feed which Visual Studio
uses to display it's latest news. Unfortunately, I couldn't figure out how to get
it to display images - it seems to reformat the feed and strip out any of the markup.
A bunch of googling didn't turn up much either.
</p>
        <p>
I briefly looked at the Visual Studio SDK a while back but the licensing cost was
prohibitive (something like $10K). I could use it for development and on my machine,
but I wouldn't be able to distribute it w/o the license. However, Microsoft just recently
changed all of that with the latest release;  ran across this via Code Magazine's
Focus issue on Visual Studio Extensibility. You can download the magazine for free
from: <a title="http://www.code-magazine.com/focus/Index.aspx" href="http://www.code-magazine.com/focus/Index.aspx">http://www.code-magazine.com/focus/Index.aspx</a>.
I downloaded the <a href="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx">SDK</a> and
got it installed with VS 2007 Beta 2 (yeah, yeah, VS 2008 was just released). Then
I kind of lost momentum and didn't do much with it. 
</p>
        <p>
This morning, while I had a bit of dead-zone time (that's the time between interruptions
that you KNOW are going to occur on some days, and they're going to be spaced so close
together that it's not worth getting involved in anything too mentally strenuous).
I ran Visual Studio Integration Package wizard and had a stub project up in running
in a few minutes (I picked the "Tool Window" option). It creates a MyControl.cs form
with a button on it, so I just deleted the button and added a PictureBox in it's place. 
</p>
        <p>
Then I just did almost a straight port of my VFP code which checks to see if it's
already downloaded the comic (and if so, it checks the dates to see if a newer one
should be available). If necessary, it downloads the file and dumps it into the PictureBox.
They've set things up so you can just "run" this project and it will automatically
start up a new instance of VS to test in, which is really nice. If you've never used
a web service in VS, it's really simple - add a reference, enter the address of the
web service and it builds a nice simple wrapper class for you. I guess I could have
done this via WCF, but I really didn't want to complicate things.
</p>
        <p>
My first test seemed OK - I selected View &gt; Other Windows and picked my new Dilbert
A Day option. The toolbar window appeared with the latest comic - so far, so good.
It docks like any other VS tool, so I docked it to the bottom of the screen. I closed
my debugging instance of VS and restarted it to see if it still worked. Nope. No image.
I ended up having to move the code which downloaded the new comic out of the control
and into the class which instanciates the form (MyToolWindow.cs). Once I had that
working, I decided it really needed to have a custom Dilbert icon. I snagged an image
from the Dilbert site, cropped it and resized it down to 16x16. There are two resources
embedded in the project which include a strip of icons. I was lazy, so I just replaced
the second icon (which seems to be the default selected inside of the pre-generated
code) in both of the BMP files.
</p>
        <p>
Here's what it ended up looking like docked at the bottom of VS:
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar1_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="138" alt="Toolbar1" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar1_thumb.png" width="360" border="0" />
          </a>
        </p>
        <p>
Here's it expanded:
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar2_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="289" alt="Toolbar2" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar2_thumb.png" width="661" border="0" />
          </a>
        </p>
        <p>
And the new menu option:
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/ToolbarMenu_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="534" alt="ToolbarMenu" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/ToolbarMenu_thumb.png" width="511" border="0" />
          </a>
        </p>
        <p>
I'm pretty happy with how this came out - this took me literally 20 minutes to put
together. Granted, this is hardly a taxing application - I could easily be swearing
at the SDK if the example were any more complex. But they at least did a nice job
to help get you up and running pretty quickly.
</p>
        <p>
OK, I admit it, this post is a bit of a tease. I had hoped to get this posted as a
installable component w/source tonight. I figured I could get the installer working
(ideally as a "ClickOnce" app, since this gives me an excuse to play with that, although
I'm not even sure it can be deployed this way) relatively quickly. However, once I
started looking at what was necessary for deployment I came across the fact that I
need to get some sort of Package Load Key (PLK) from Microsoft, which requires me
to sign up for the <a href="http://www.vsipmembers.com/">Microsoft Visual Studio Industry
Partner Program</a> website. That's actually pretty painless, and it looks like they've
got a simple interface to request this key:
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/VSIP_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="512" alt="VSIP" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/VSIP_thumb.png" width="785" border="0" />
          </a>
        </p>
        <p>
At that point, it wants me to answer a bunch of questions about the download location,
product logo, etc. that I wasn't really ready to deal with. The final deployment aspect
of all of this also seemed to be missing in the docs I've read. I ended up having
to do some more digging through the Code Focus issue and came across <a href="http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx">this
link</a> which has a video which covers deployment (yeah!). I'll have to watch the
full video (it's around 20 minutes) before I can finish this thing up. 
</p>
        <p>
I'll follow up with that in another post, along with a bit of code from the project
and maybe a simple comparison of the VFP code vs the .NET code. I guess I'll also
have to put up a downloads section to make it easier to find all of this stuff, especially
if I need to provide all of that to generate a PLK. Let's hope this 20 minute quickie
project doesn't turn into some huge odyssey - unfortunately, that seems to happen
a lot in development, doesn't it?
</p>
        <p>
 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a title="http://www.code-magazine.com/focus/Index.aspx" href="http://www.code-magazine.com/focus/Index.aspx">http://www.code-magazine.com/focus/Index.aspx</a> <br /><a title="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx" href="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx">http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx</a><br /><a href="http://www.vsipmembers.com/">http://www.vsipmembers.com/</a><br /><a title="http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx" href="http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx">http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx</a></p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=c8672676-2e56-4b2d-8571-6dbe84a4f917" />
      </body>
      <title>Dilbert-A-Day.NET</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,c8672676-2e56-4b2d-8571-6dbe84a4f917.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/11/20/DilbertADayNET.aspx</link>
      <pubDate>Tue, 20 Nov 2007 03:28:20 GMT</pubDate>
      <description>&lt;p&gt;
I thought it might be fun to convert an old VFP app. I wrote when I was playing around
with web services inside of VFP to work inside of Visual Studio. It was a simple program
which connected to a webservice which serves up a new Dilbert comic every day, then
it displays it in the VFP desktop. I've been thinking about doing it for a while -
my initial thought was to modify and/or customize the RSS feed which Visual Studio
uses to display it's latest news. Unfortunately, I couldn't figure out how to get
it to display images - it seems to reformat the feed and strip out any of the markup.
A bunch of googling didn't turn up much either.
&lt;/p&gt;
&lt;p&gt;
I briefly looked at the Visual Studio SDK a while back but the licensing cost was
prohibitive (something like $10K). I could use it for development and on my machine,
but I wouldn't be able to distribute it w/o the license. However, Microsoft just recently
changed all of that with the latest release;&amp;nbsp; ran across this via Code Magazine's
Focus issue on Visual Studio Extensibility. You can download the magazine for free
from: &lt;a title="http://www.code-magazine.com/focus/Index.aspx" href="http://www.code-magazine.com/focus/Index.aspx"&gt;http://www.code-magazine.com/focus/Index.aspx&lt;/a&gt;.
I downloaded the &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx"&gt;SDK&lt;/a&gt; and
got it installed with VS 2007 Beta 2 (yeah, yeah, VS 2008 was just released). Then
I kind of lost momentum and didn't do much with it. 
&lt;/p&gt;
&lt;p&gt;
This morning, while I had a bit of dead-zone time (that's the time between interruptions
that you KNOW are going to occur on some days, and they're going to be spaced so close
together that it's not worth getting involved in anything too mentally strenuous).
I ran Visual Studio Integration Package wizard and had a stub project up in running
in a few minutes (I picked the "Tool Window" option). It creates a MyControl.cs form
with a button on it, so I just deleted the button and added a PictureBox in it's place. 
&lt;/p&gt;
&lt;p&gt;
Then I just did almost a straight port of my VFP code which checks to see if it's
already downloaded the comic (and if so, it checks the dates to see if a newer one
should be available). If necessary, it downloads the file and dumps it into the PictureBox.
They've set things up so you can just "run" this project and it will automatically
start up a new instance of VS to test in, which is really nice. If you've never used
a web service in VS, it's really simple - add a reference, enter the address of the
web service and it builds a nice simple wrapper class for you. I guess I could have
done this via WCF, but I really didn't want to complicate things.
&lt;/p&gt;
&lt;p&gt;
My first test seemed OK - I selected View &amp;gt; Other Windows and picked my new Dilbert
A Day option. The toolbar window appeared with the latest comic - so far, so good.
It docks like any other VS tool, so I docked it to the bottom of the screen. I closed
my debugging instance of VS and restarted it to see if it still worked. Nope. No image.
I ended up having to move the code which downloaded the new comic out of the control
and into the class which instanciates the form (MyToolWindow.cs). Once I had that
working, I decided it really needed to have a custom Dilbert icon. I snagged an image
from the Dilbert site, cropped it and resized it down to 16x16. There are two resources
embedded in the project which include a strip of icons. I was lazy, so I just replaced
the second icon (which seems to be the default selected inside of the pre-generated
code) in both of the BMP files.
&lt;/p&gt;
&lt;p&gt;
Here's what it ended up looking like docked at the bottom of VS:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar1_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="138" alt="Toolbar1" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar1_thumb.png" width="360" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Here's it expanded:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar2_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="289" alt="Toolbar2" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/Toolbar2_thumb.png" width="661" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
And the new menu option:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/ToolbarMenu_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="534" alt="ToolbarMenu" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/ToolbarMenu_thumb.png" width="511" border="0"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I'm pretty happy with how this came out - this took me literally 20 minutes to put
together. Granted, this is hardly a taxing application - I could easily be swearing
at the SDK if the example were any more complex. But they at least did a nice job
to help get you up and running pretty quickly.
&lt;/p&gt;
&lt;p&gt;
OK, I admit it, this post is a bit of a tease. I had hoped to get this posted as a
installable component w/source tonight. I figured I could get the installer working
(ideally as a "ClickOnce" app, since this gives me an excuse to play with that, although
I'm not even sure it can be deployed this way) relatively quickly. However, once I
started looking at what was necessary for deployment I came across the fact that I
need to get some sort of Package Load Key (PLK) from Microsoft, which requires me
to sign up for the &lt;a href="http://www.vsipmembers.com/"&gt;Microsoft Visual Studio Industry
Partner Program&lt;/a&gt; website. That's actually pretty painless, and it looks like they've
got a simple interface to request this key:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/VSIP_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="512" alt="VSIP" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/DilbertADay.NET_125D2/VSIP_thumb.png" width="785" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
At that point, it wants me to answer a bunch of questions about the download location,
product logo, etc. that I wasn't really ready to deal with. The final deployment aspect
of all of this also seemed to be missing in the docs I've read. I ended up having
to do some more digging through the Code Focus issue and came across &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx"&gt;this
link&lt;/a&gt; which has a video which covers deployment (yeah!). I'll have to watch the
full video (it's around 20 minutes) before I can finish this thing up. 
&lt;/p&gt;
&lt;p&gt;
I'll follow up with that in another post, along with a bit of code from the project
and maybe a simple comparison of the VFP code vs the .NET code. I guess I'll also
have to put up a downloads section to make it easier to find all of this stuff, especially
if I need to provide all of that to generate a PLK. Let's hope this 20 minute quickie
project doesn't turn into some huge odyssey - unfortunately, that seems to happen
a lot in development, doesn't it?
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://www.code-magazine.com/focus/Index.aspx" href="http://www.code-magazine.com/focus/Index.aspx"&gt;http://www.code-magazine.com/focus/Index.aspx&lt;/a&gt;&amp;nbsp;&lt;br&gt;
&lt;a title="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx" href="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx"&gt;http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.vsipmembers.com/"&gt;http://www.vsipmembers.com/&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx" href="http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx"&gt;http://msdn2.microsoft.com/en-us/vstudio/aa700829.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=c8672676-2e56-4b2d-8571-6dbe84a4f917" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,c8672676-2e56-4b2d-8571-6dbe84a4f917.aspx</comments>
      <category>Visual Studio SDK</category>
    </item>
  </channel>
</rss>