<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Henrik Falk&#039;s Blog</title>
	<atom:link href="http://henrikfalk.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://henrikfalk.wordpress.com</link>
	<description>Like totally a blog about stuff</description>
	<lastBuildDate>Tue, 20 Sep 2011 21:37:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='henrikfalk.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Henrik Falk&#039;s Blog</title>
		<link>http://henrikfalk.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://henrikfalk.wordpress.com/osd.xml" title="Henrik Falk&#039;s Blog" />
	<atom:link rel='hub' href='http://henrikfalk.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Blog Moved</title>
		<link>http://henrikfalk.wordpress.com/2011/07/09/blog-moved/</link>
		<comments>http://henrikfalk.wordpress.com/2011/07/09/blog-moved/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 16:41:16 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Japanese]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=377</guid>
		<description><![CDATA[This blog have been continued here: http://www.henrikfalk.se I have a non technical blog here: http://www.nerdyentertainment.com<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=377&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog have been continued here:<br />
<a href="http://www.henrikfalk.se" title="http://www.henrikfalk.se">http://www.henrikfalk.se</a></p>
<p>I have a non technical blog here:<br />
<a href="http://www.nerdyentertainment.com" title="http://www.nerdyentertainment.com">http://www.nerdyentertainment.com</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/377/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=377&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2011/07/09/blog-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>Send Lotus Notes emails using VBS</title>
		<link>http://henrikfalk.wordpress.com/2011/02/01/send-lotus-notes-emails-using-vbs/</link>
		<comments>http://henrikfalk.wordpress.com/2011/02/01/send-lotus-notes-emails-using-vbs/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 22:06:15 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=373</guid>
		<description><![CDATA[Here&#8217;s a block of code to send a Lotus Notes email using VBS. Set objNotes = CreateObject("Lotus.NotesSession") Call objNotes.Initialize(strNotesPassword) Set Maildb = objNotes.GetDatabase("", strLotusNotesDatabase) If Not Maildb.IsOpen = True Then Call Maildb.Open End If Set MailDoc = Maildb.CreateDocument Call MailDoc.ReplaceItemValue("Form", "Memo") Call MailDoc.ReplaceItemValue("SendTo", arrSendTo) Call MailDoc.ReplaceItemValue("BlindCopyTo", arrBlindCopyTo) Call MailDoc.ReplaceItemValue("Subject", strSubject) Set Body = MailDoc.CreateRichTextItem("Body") Call [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=373&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a block of code to send a Lotus Notes email using VBS.</p>
<pre>
<code>
Set objNotes = CreateObject("Lotus.NotesSession")
Call objNotes.Initialize(strNotesPassword)
Set Maildb = objNotes.GetDatabase("", strLotusNotesDatabase)
If Not Maildb.IsOpen = True Then
  Call Maildb.Open
End If
Set MailDoc = Maildb.CreateDocument
Call MailDoc.ReplaceItemValue("Form", "Memo")
Call MailDoc.ReplaceItemValue("SendTo", arrSendTo)
Call MailDoc.ReplaceItemValue("BlindCopyTo", arrBlindCopyTo)
Call MailDoc.ReplaceItemValue("Subject", strSubject)
Set Body = MailDoc.CreateRichTextItem("Body")
Call Body.AppendText(strBodyText)
Call Body.AddNewLine(2)
Call Body.EmbedObject(1454, "", c:\attachment.doc", "Attachment")
MailDoc.SaveMessageOnSend = True
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.Send(False)
</code>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=373&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2011/02/01/send-lotus-notes-emails-using-vbs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>Get the local IP using VBS</title>
		<link>http://henrikfalk.wordpress.com/2011/02/01/get-the-local-ip-using-vbs/</link>
		<comments>http://henrikfalk.wordpress.com/2011/02/01/get-the-local-ip-using-vbs/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 22:03:42 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=368</guid>
		<description><![CDATA[This is a handy function that returns the local IP settings. I run it (like many people) at boot on servers to have the IP address sent to me every time the server starts up, in case the IP have changed. Function GetLocalIPConfig strResult = "" With CreateObject("Wscript.Shell").Exec("ipconfig").StdOut Do Until .AtEndOfStream strResult = strResult &#38; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=368&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a handy function that returns the local IP settings.<br />
I run it (like many people) at boot on servers to have the IP address<br />
sent to me every time the server starts up, in case the IP have changed.</p>
<pre>
<code>Function GetLocalIPConfig
  strResult = ""
  With CreateObject("Wscript.Shell").Exec("ipconfig").StdOut
    Do Until .AtEndOfStream
      strResult = strResult &amp; .ReadLine
    Loop
  End With
  GetLocalIPConfig = strResult
End Function
</code>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/368/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=368&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2011/02/01/get-the-local-ip-using-vbs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>VBS and OpenOffice</title>
		<link>http://henrikfalk.wordpress.com/2010/08/31/vbs-and-openoffice/</link>
		<comments>http://henrikfalk.wordpress.com/2010/08/31/vbs-and-openoffice/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 21:00:47 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=351</guid>
		<description><![CDATA[Here&#8217;s a quick piece of code that opens an OpenOffice Calc spreadsheet, writes text to a cell, and makes that text bold. Set objServiceManager = CreateObject(&#8220;com.sun.star.ServiceManager&#8221;) Set objDesktop = objServiceManager.createInstance(&#8220;com.sun.star.frame.Desktop&#8221;) Set objCalcDoc = objDesktop.loadComponentFromURL(&#8220;file:///C:/file.ods&#8221;, &#8220;_blank&#8221;, 0, Array()) Set objSheet = objCalcDoc.getSheets().getByIndex(0) objSheet.getCellByPosition(0, 0).SetString(&#8220;Henrik Falk&#8221;) objSheet.getCellByPosition(0, 0).charWeight = 150 If you want to open a new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=351&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick piece of code that opens an OpenOffice Calc spreadsheet, writes text to a cell, and makes that text bold.</p>
<p><em>Set objServiceManager = CreateObject(&#8220;com.sun.star.ServiceManager&#8221;)<br />
Set objDesktop = objServiceManager.createInstance(&#8220;com.sun.star.frame.Desktop&#8221;)<br />
Set objCalcDoc = objDesktop.loadComponentFromURL(&#8220;file:///C:/file.ods&#8221;, &#8220;_blank&#8221;, 0, Array())<br />
Set objSheet = objCalcDoc.getSheets().getByIndex(0)<br />
objSheet.getCellByPosition(0, 0).SetString(&#8220;Henrik Falk&#8221;)<br />
objSheet.getCellByPosition(0, 0).charWeight = 150</em></p>
<p>If you want to open a new spreadsheet, use this code instead:<br />
<em>Set objCalcDoc = objDesktop.loadComponentFromURL(&#8220;private:factory/scalc&#8221;, &#8220;_blank&#8221;, 0, Array())</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=351&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2010/08/31/vbs-and-openoffice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>MCTS</title>
		<link>http://henrikfalk.wordpress.com/2009/12/02/mcts/</link>
		<comments>http://henrikfalk.wordpress.com/2009/12/02/mcts/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 14:10:31 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=344</guid>
		<description><![CDATA[I passed 83-640!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=344&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I passed 83-640!</p>
<p><a href="http://henrikfalk.files.wordpress.com/2009/12/mcts.jpg"><img class="alignnone size-full wp-image-345" title="MCTS" src="http://henrikfalk.files.wordpress.com/2009/12/mcts.jpg?w=450" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/344/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=344&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2009/12/02/mcts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/12/mcts.jpg" medium="image">
			<media:title type="html">MCTS</media:title>
		</media:content>
	</item>
		<item>
		<title>XMLHttpRequest</title>
		<link>http://henrikfalk.wordpress.com/2009/11/10/xmlhttprequest/</link>
		<comments>http://henrikfalk.wordpress.com/2009/11/10/xmlhttprequest/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 20:24:05 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=337</guid>
		<description><![CDATA[I recently wanted to get information from a web interface, I just wanted to send a query to the server, and get a response. XMLHttpRequest does just that. I choose to implement it using JavaScript, that seems to be the most common way. The following code sends a GET request to www.google.com var url = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=337&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to get information from a web interface, I just wanted to send a query to the server, and get a response. XMLHttpRequest does just that. I choose to implement it using JavaScript, that seems to be the most common way.</p>
<p>The following code sends a GET request to www.google.com</p>
<pre>var url = "www.google.com";
var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
textArea.value = request.responseText;
</pre>
<p>The false entry in the call to the open function means that this call isn&#8217;t asynchronous, that is, the script will pause until it gets a response from the server before continuing running. The null parameter in the send method doesn&#8217;t seem to be necessary, but it&#8217;s supposed to be there. responseText is the result as plain text returned by the server. If the response is valid XML, that will be stored in responseXML.</p>
<p>Not terribly exciting looking at the source code for the front page of Google though . Luckily Google uses GET for it&#8217;s searches, so we can easily modify the URL to this:</p>
<pre>var url = "http://www.google.com/search?q=IBM";
var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
textArea.value = request.responseText;
</pre>
<p>Or even:</p>
<pre>
<pre>var term = "IBM";
var url = "http://www.google.com/search?q=" + term;
var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
textArea.value = request.responseText;</pre>
</pre>
<p>We will now get the search results for the search term IBM. Mind you it&#8217;s just the source code for the result page, it&#8217;s not very pretty, but the information is there.</p>
<p>If we want to use the POST method, things get a bit trickier since we can&#8217;t just modify the URL.</p>
<pre>var param = "search?q=IBM";
var url = "http://www.google.com";
var request = new XMLHttpRequest();
request.open("POST", url, false);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", param.length);
request.setRequestHeader("Connection", "keep-alive");
request.send(param);
</pre>
<p>So, what&#8217;s new here? The first one is the param variable. It&#8217;s pretty much what would have been added after the URL had this been a GET request. Next we can see that we now call the open method with the POST parameter. Then we need to specify the HTTP headers that has to be in a POST request. Finally we can see that we are now sending our parameter to the send method instead of attaching it to the end of the URL.</p>
<p>I used all this to interface with a site that I didn&#8217;t control. Luckily, since I did it in an HTA, it worked. When I tried it as a website it wouldn&#8217;t work. I&#8217;m assuming that it&#8217;s because of the same origin policy in my browser. It&#8217;s not allowing me to load something from another site then the one the script is running in. I&#8217;m sure there&#8217;s a way around that, but so far my HTA is working fine anyway.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=337&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2009/11/10/xmlhttprequest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>UTF8ToUTF16</title>
		<link>http://henrikfalk.wordpress.com/2009/09/10/utf8toutf16/</link>
		<comments>http://henrikfalk.wordpress.com/2009/09/10/utf8toutf16/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:50:53 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[utf]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=329</guid>
		<description><![CDATA[I wrote this script since I had to convert between UTF8 and UTF16 using vbscript. It turned out to be very non intuitive. A definition of UTF8 can be found here. I have only used it to translate from 3 octets of bytes (the type starting with 1110), but the principle should stand. Function UTF8ToUTF16(strUTF8) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=329&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote this script since I had to convert between UTF8 and UTF16 using vbscript. It turned out to be very non intuitive. A definition of UTF8 can be found <a href="http://en.wikipedia.org/wiki/UTF-8" target="_blank"> here</a>.</p>
<p>I have only used it to translate from 3 octets of bytes (the type starting with 1110), but the principle should stand.</p>
<pre>Function UTF8ToUTF16(strUTF8)
  binUTF8 = HexToBin(strUTF8)
  if left(binUTF8, 1) = "0" then
    strResult = "0" &amp; BinToHex(mid(binUTF8, 2, 7))
  elseif left(binUTF8, 3) = "110" then
    strResult = "0" &amp; mid(binUTF8, 2, 7) &amp; mid(binUTF8, 11, 6)
  elseif left(binUTF8, 4) = "1110" then
    strResult = mid(binUTF8, 5, 4) &amp; mid(binUTF8, 11, 6) &amp; mid(binUTF8, 19, 6)
  elseif left(binUTF8, 5) = "11110" then
    strResult = "000" &amp; mid(binUTF8, 6, 3) &amp; mid(binUTF8, 11, 6) &amp; mid(binUTF8, 27, 6)
  end if
  UTF8ToUTF16 = BinToHex(strResult)
End Function</pre>
<p>Here are the BinToHex and the HexToBin functions that it uses.</p>
<pre>Function HexToBin(hexNumber)
redim arrHexNumber(len(hexNumber) - 1)
 for i=1 to len(hexNumber)
 arrHexNumber(i - 1) = mid(hexNumber, i, 1)
 next
 for each hexChar in arrHexNumber
 if hexChar = "0" then strResult = strResult &amp; "0000"
 if hexChar = "1" then strResult = strResult &amp; "0001"
 if hexChar = "2" then strResult = strResult &amp; "0010"
 if hexChar = "3" then strResult = strResult &amp; "0011"
 if hexChar = "4" then strResult = strResult &amp; "0100"
 if hexChar = "5" then strResult = strResult &amp; "0101"
 if hexChar = "6" then strResult = strResult &amp; "0110"
 if hexChar = "7" then strResult = strResult &amp; "0111"
 if hexChar = "8" then strResult = strResult &amp; "1000"
 if hexChar = "9" then strResult = strResult &amp; "1001"
 if hexChar = "A" then strResult = strResult &amp; "1010"
 if hexChar = "B" then strResult = strResult &amp; "1011"
 if hexChar = "C" then strResult = strResult &amp; "1100"
 if hexChar = "D" then strResult = strResult &amp; "1101"
 if hexChar = "E" then strResult = strResult &amp; "1110"
 if hexChar = "F" then strResult = strResult &amp; "1111"
 next
 HexToBin = strResult
End Function

Function BinToHex(binNumber)
redim arrBinNumber(len(binNumber) - 1)
 for i=1 to len(binNumber) step 4
 arrBinNumber(i - 1) = mid(binNumber, i, 4)
 next
 for each binChar in arrBinNumber
 if binChar = "0000" then strResult = strResult &amp; "0"
 if binChar = "0001" then strResult = strResult &amp; "1"
 if binChar = "0010" then strResult = strResult &amp; "2"
 if binChar = "0011" then strResult = strResult &amp; "3"
 if binChar = "0100" then strResult = strResult &amp; "4"
 if binChar = "0101" then strResult = strResult &amp; "5"
 if binChar = "0110" then strResult = strResult &amp; "6"
 if binChar = "0111" then strResult = strResult &amp; "7"
 if binChar = "1000" then strResult = strResult &amp; "8"
 if binChar = "1001" then strResult = strResult &amp; "9"
 if binChar = "1010" then strResult = strResult &amp; "A"
 if binChar = "1011" then strResult = strResult &amp; "B"
 if binChar = "1100" then strResult = strResult &amp; "C"
 if binChar = "1101" then strResult = strResult &amp; "D"
 if binChar = "1110" then strResult = strResult &amp; "E"
 if binChar = "1111" then strResult = strResult &amp; "F"
 next
 BinToHex = strResult
End Function</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/329/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=329&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2009/09/10/utf8toutf16/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>Hexadecimal</title>
		<link>http://henrikfalk.wordpress.com/2009/07/22/hexadecimal/</link>
		<comments>http://henrikfalk.wordpress.com/2009/07/22/hexadecimal/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 10:19:49 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[hexadecimal]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=319</guid>
		<description><![CDATA[Not everyone sees the point with the hexadecimal numeral system, often called hex for short. It might be seen as just another weird system that isn&#8217;t decimal. I like hexadecimal since it has a direct correlation to the binary numeral system. Each number in the hexadecimal system represents four numbers in the binary system. This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=319&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Not everyone sees the point with the hexadecimal numeral system, often called hex for short. It might be seen as just another weird system that isn&#8217;t decimal.</p>
<p>I like hexadecimal since it has a direct correlation to the binary numeral system.</p>
<p>Each number in the hexadecimal system represents four numbers in the binary system. This is because hexadecimal uses the radix 16, and binary the radix 2. And 2^4 = 16.</p>
<p>The usefulness of hex quickly becomes apparent when you are working with large binary numbers. If you want to translate 0101 to decimal, you have to find the value for each of the numbers individually and add them up.</p>
<p>In this case it isn&#8217;t very hard. 8*0 + 4*1 + 2*0 + 1*1 = 5. And in hexadecimal 5 is still 5.</p>
<p>Lets try a longer binary number, 1001 0101. Now it gets harder (more time consuming) to convert it to decimal.</p>
<p>128*1 + 64*0 + 32*0 + 16*1 + 8*0 + 4*1 + 2*0 + 1*1 = 149</p>
<p>This is when hexadecimal starts to shine. Remember that one hexadecimal number equals four binary numbers? That means that we can separate the binary numbers and translate them to hexadecimal in groups of four.</p>
<p>First we translate 0101, since we already know that&#8217;s 5 in decimal and hex.</p>
<p>Then we translate 1001 to decimal.<br />
8*1 + 4*0 + 2*0 + 1*1 = 9. So in hexadecimal 1001 0101 is written 95.</p>
<p>Binary          1001 0101<br />
Hexadecimal    9      5</p>
<p>This means that we never have to work with larger binary numbers then four bytes when translating to hex. Since the range of four bits in decimal is 0 to 15, this is something that comes naturally after a short time of working with them.</p>
<p>Does this mean that hex is easy to read? Of course not, but it&#8217;s easier to read then binary, and since there is a direct correlation between hex and binary, that&#8217;s what makes hex useful.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/319/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=319&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2009/07/22/hexadecimal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>C# OpenProcess</title>
		<link>http://henrikfalk.wordpress.com/2009/07/21/c-openprocess/</link>
		<comments>http://henrikfalk.wordpress.com/2009/07/21/c-openprocess/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 11:07:09 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DllImport]]></category>
		<category><![CDATA[OpenProcess]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=302</guid>
		<description><![CDATA[Certain tasks simply can&#8217;t be done using only managed code. In order to call a Win32 API (or simply a DLL) using C#, DllImport is used. DllImport resides in the namespace System.Runtime.InteropServices. If you want to implement the OpenProcess Function in C#. We can see on MSDN that the C++ definition for the function is: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=302&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Certain tasks simply can&#8217;t be done using only managed code. In order to call a Win32 API (or simply a DLL) using C#, DllImport is used. DllImport resides in the namespace System.Runtime.InteropServices.</p>
<p>If you want to implement the <a href="http://msdn.microsoft.com/en-us/library/ms684320%28VS.85%29.aspx" target="_blank">OpenProcess</a> Function in C#. We can see on MSDN that the C++ definition for the function is:</p>
<pre>
<pre style="white-space:pre-wrap;"><code>HANDLE WINAPI OpenProcess(
  __in  DWORD <em>dwDesiredAccess</em>,
  __in  BOOL <em>bInheritHandle</em>,
  __in  DWORD <em>dwProcessId</em>
);</code></pre>
</pre>
<p>In C# thats written:</p>
<pre>[DllImport("kernel32.dll")]
  public static extern IntPtr OpenProcess(
  int dwDesiredAccess,
  bool bInheritHandle,
  int dwProcessId
);</pre>
<p>To not get ahead or myself, this is the code I used to get the handle to the process.  The class Process resides in the namespace System.Diagnostics.</p>
<pre>Process[] hProcess = Process.GetProcessesByName("calc");</pre>
<p>This line of code returns an array of all the instances of the calculator running on your machine.</p>
<pre>IntPtr hReadProcess = OpenProcess(0x0010, true, handle[0].Id);</pre>
<p>This line of code opens the first instance of the calculator found, and assigns the handle to hReadProcess. 0&#215;0010 is the <a href="http://msdn.microsoft.com/en-us/library/ms684880%28VS.85%29.aspx" target="_blank">process access right</a> specified to open the process with. 0&#215;0010 means PROCESS_VM_READ, and is needed in order to use the ReadProcessMemory function on the process.</p>
<p>On MSDN we can see that if the OpenProcess function succeeds, it return&#8217;s an open handle. That&#8217;s of course to be expected.</p>
<p>But if the function fails, it will return null, still not a problem, <strong>but</strong> we are referred to call GetLastError to get a more specific error message. GetLasError unfortunately doesn&#8217;t work in C#. Sure, it &#8220;works&#8221; but the CLR itself could very easily make it&#8217;s own calls and all of a sudden the last error message isn&#8217;t what you are after.</p>
<p>In order to fix this problem, all we need to do is add SetLastError=true to our DllImport statement. It should now look like this:</p>
<pre>[DllImport("kernel32.dll",SetLastError=true)]
  public static extern IntPtr OpenProcess(
  int dwDesiredAccess,
  bool bInheritHandle,
  int dwProcessId
);</pre>
<p>Now that this is done, you can call Marshal.GetLastWin32Error, that is found in the System.Runtime.InteropServices, which we need to use anyway because of DllImport.</p>
<p>Now simply use this line of code to get the last error message:</p>
<pre>MessageBox.Show(Marshal.GetLastWin32Error().ToString());</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=302&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2009/07/21/c-openprocess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Virtual PC 2007</title>
		<link>http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/</link>
		<comments>http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 20:14:04 +0000</pubDate>
		<dc:creator>Henrik Falk</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Microsoft Virtual PC 2007]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://henrikfalk.wordpress.com/?p=235</guid>
		<description><![CDATA[In order to have a way to test and develop my server scripts and programs locally, I use Microsoft Virtual PC 2007. Which can be downloaded here. Since I don&#8217;t want or have the need for a full version of a server operating system, I&#8217;m using a trial version of Windows Server 2003 that can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=235&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In order to have a way to test and develop my server scripts and programs locally, I use Microsoft Virtual PC 2007. Which can be downloaded <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&amp;displaylang=en" target="_blank">here</a>.</p>
<p>Since I don&#8217;t want or have the need for a full version of a server operating system, I&#8217;m using a trial version of Windows Server 2003 that can be downloaded <a href="http://technet.microsoft.com/en-us/windowsserver/bb430831.aspx" target="_blank">here</a>.</p>
<p>Make sure that you download the 32-bit version, since Virtual PC emulates a Intel Pentium III. It&#8217;s said that it emulates the host CPU on the Windows versions, but I haven&#8217;t had any luck with that.</p>
<p>The drawback of downloading Windows 2003 is that you have to install it on your virtual hard drive yourself. If you on the other hand want to run Windows Server 2008, you can download it preinstalled on a virtual hard drive <a href="http://www.microsoft.com/windowsserver2008/en/us/virtual-hard-drive.aspx" target="_blank">here</a>. The evaluation period is initially 60 days, but can be reset 2 times using <a href="http://www.win2008workstation.com/wordpress/2008/07/17/windows-server-2008-workstation-converter/" target="_blank">this</a> tool. Just look under the tab called Delay Activation.</p>
<p>This is the first thing that you will see when you start Microsoft Virtual PC for the first time.</p>
<div id="attachment_252" class="wp-caption alignnone" style="width: 377px"><a rel="attachment wp-att-252" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/mvpcstart/"><img class="size-full wp-image-252" title="mvpcstart" src="http://henrikfalk.files.wordpress.com/2009/06/mvpcstart8.jpg?w=450" alt="Microsoft Virtual PC"   /></a><p class="wp-caption-text">Microsoft Virtual PC</p></div>
<p>Click in the New&#8230; button, and you will get to a Wizard.</p>
<p><a rel="attachment wp-att-257" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/options/"><img class="alignnone size-full wp-image-257" title="options" src="http://henrikfalk.files.wordpress.com/2009/06/options.jpg?w=450&#038;h=350" alt="options" width="450" height="350" /></a></p>
<p>Choose Create a virtual machine.</p>
<p><a rel="attachment wp-att-262" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/nameandlocation/"><img class="alignnone size-full wp-image-262" title="nameandlocation" src="http://henrikfalk.files.wordpress.com/2009/06/nameandlocation.jpg?w=450&#038;h=350" alt="nameandlocation" width="450" height="350" /></a></p>
<p>This specifies what the virtual machine will be called and where the settings file will be located.</p>
<p><a rel="attachment wp-att-263" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/operatingsystem/"><img class="alignnone size-full wp-image-263" title="operatingsystem" src="http://henrikfalk.files.wordpress.com/2009/06/operatingsystem.jpg?w=450&#038;h=350" alt="operatingsystem" width="450" height="350" /></a></p>
<p>Since we called the vmc (Virtual Machine Configuration) Windows Server 2003, Virtual PC automatically chooses Windows 2003 default settings for the virtual machine.</p>
<p><a rel="attachment wp-att-264" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/ram/"><img class="alignnone size-full wp-image-264" title="ram" src="http://henrikfalk.files.wordpress.com/2009/06/ram.jpg?w=450&#038;h=350" alt="ram" width="450" height="350" /></a></p>
<p>Since the default RAM is just 256 MB, I&#8217;m changing that to 1024 since I have the RAM to spare. I wouldn&#8217;t recommend giving it less then 512 MB though.</p>
<p><a rel="attachment wp-att-265" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/newvhd/"><img class="alignnone size-full wp-image-265" title="newvhd" src="http://henrikfalk.files.wordpress.com/2009/06/newvhd.jpg?w=450&#038;h=350" alt="newvhd" width="450" height="350" /></a></p>
<p>Since this is the first time using Virtual PC, you probably don&#8217;t have a virtual hard disk, so lets create a new one.</p>
<p><a rel="attachment wp-att-266" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/vhdsize/"><img class="alignnone size-full wp-image-266" title="vhdsize" src="http://henrikfalk.files.wordpress.com/2009/06/vhdsize.jpg?w=450&#038;h=350" alt="vhdsize" width="450" height="350" /></a></p>
<p>The default size of a new vhd (Virtual Hard Drive) is 65536 MB (64 GB). I think that&#8217;s a bit much, so I&#8217;m changing that to 10240 MB. That&#8217;s enough for Windows 2003 even if you install things like Visual C# 2008 Express Edition.</p>
<p>After that you are finished creating a virtual machine, and you will see this.</p>
<p><a rel="attachment wp-att-269" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/mvpcw2003/"><img class="alignnone size-full wp-image-269" title="mvpcw2003" src="http://henrikfalk.files.wordpress.com/2009/06/mvpcw2003.jpg?w=450" alt="mvpcw2003"   /></a></p>
<p>Before clicking on Start, there are a few settings that should be changed.</p>
<p><a rel="attachment wp-att-270" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/mvpnetworking/"><img class="alignnone size-full wp-image-270" title="mvpnetworking" src="http://henrikfalk.files.wordpress.com/2009/06/mvpnetworking.jpg?w=450&#038;h=319" alt="mvpnetworking" width="450" height="319" /></a></p>
<p>The options are Not connected (no networking available), Local only (networking is enabled, but only between virtual machines), a physical network card on the host machine (makes the virtual machine connect directly to the specified network interface and behave like another physical machine on the network) and Shared networking (NAT) (the virtual machine connects to the network through the host computer). I like to choose NAT here, but if you don&#8217;t want to bother with networking, just choose Not connected, and enable Shared Folders, as shown below.</p>
<p><a rel="attachment wp-att-271" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/mvpcsharedfolders/"><img class="alignnone size-full wp-image-271" title="mvpcsharedfolders" src="http://henrikfalk.files.wordpress.com/2009/06/mvpcsharedfolders.jpg?w=450&#038;h=319" alt="mvpcsharedfolders" width="450" height="319" /></a></p>
<p>As you can see, this cannot be enabled until the virtual machine additions are installed, so I will get to that later on.</p>
<p>Now start the virtual machine. Since there isn&#8217;t an operating system installed yet, this is what you will see.</p>
<p><a rel="attachment wp-att-273" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/firstboot-2/"><img class="alignnone size-full wp-image-273" title="firstboot" src="http://henrikfalk.files.wordpress.com/2009/06/firstboot1.jpg?w=450&#038;h=329" alt="firstboot" width="450" height="329" /></a></p>
<p>In order to solve that problem, click on CD, and choose Capture ISO Image&#8230;</p>
<p><a rel="attachment wp-att-274" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/captureisoimage/"><img class="alignnone size-full wp-image-274" title="captureisoimage" src="http://henrikfalk.files.wordpress.com/2009/06/captureisoimage.jpg?w=450&#038;h=329" alt="captureisoimage" width="450" height="329" /></a></p>
<p>Now simply choose the ISO file with Windows 2003, and restart the virtual machine.</p>
<p><a rel="attachment wp-att-275" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/reset/"><img class="alignnone size-full wp-image-275" title="reset" src="http://henrikfalk.files.wordpress.com/2009/06/reset.jpg?w=450&#038;h=329" alt="reset" width="450" height="329" /></a></p>
<p>Since the virtual machine now have the install CD set as it&#8217;s CD drive, the Windows 2003 installation will begin.</p>
<p><a rel="attachment wp-att-276" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/windowsinstall/"><img class="alignnone size-full wp-image-276" title="windowsinstall" src="http://henrikfalk.files.wordpress.com/2009/06/windowsinstall.jpg?w=450&#038;h=326" alt="windowsinstall" width="450" height="326" /></a></p>
<p>You get to install the operating system any way that you want to, I won&#8217;t be covering how to do that here.</p>
<p>Since you need to press Ctrl+Alt+Delete to log in to Windows 2003, there is a slight problem. Ctrl+Alt+Delete is designed to always go to the operating system. So in this case it will go to your physical machine, no matter if you have the virtual machine in focus or not. To solve that problem there is  an option in the menu that you can click on. As you can see, pressing Alt+Delete will also send a Ctrl+Alt+Delete to the virtual machine, so that you don&#8217;t have to click in the menu every time.</p>
<p><a rel="attachment wp-att-279" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/ctraltdelete/"><img class="alignnone size-full wp-image-279" title="ctraltdelete" src="http://henrikfalk.files.wordpress.com/2009/06/ctraltdelete.jpg?w=450" alt="ctraltdelete"   /></a></p>
<p>When Windows have booted, click on Action -&gt; Install or Update Virtual Machine Additions. If you are having problems clicking on Action, because the guest operating system have stolen the mouse pointer, press Alt to get it back.</p>
<p><a rel="attachment wp-att-277" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/vmainstall/"><img class="alignnone size-full wp-image-277" title="vmainstall" src="http://henrikfalk.files.wordpress.com/2009/06/vmainstall.jpg?w=450" alt="vmainstall"   /></a></p>
<p>You will get a Wizard that is very easy to follow. After it&#8217;s done, accept the option to restart your system.</p>
<p>Now you can right click on the folder down in the lower left corner and click Share Folder.</p>
<p><a rel="attachment wp-att-282" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/sharefolder/"><img class="alignnone size-full wp-image-282" title="sharefolder" src="http://henrikfalk.files.wordpress.com/2009/06/sharefolder.jpg?w=450" alt="sharefolder"   /></a></p>
<p>You will get a window to choose which folder from the host operating system to share, and which drive letter to give it.</p>
<p><a rel="attachment wp-att-283" href="http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/sharefolderbrowse/"><img class="alignnone size-full wp-image-283" title="sharefolderbrowse" src="http://henrikfalk.files.wordpress.com/2009/06/sharefolderbrowse.jpg?w=450" alt="sharefolderbrowse"   /></a></p>
<p>You will also notice that you don&#8217;t have to press the Alt key to get your mouse pointer back, it will now be released automatically when you move it out from the virtual machine window.</p>
<p>That&#8217;s how to get a virtual Windows 2003 machine set up, but this works with most operating system. I have even gotten it to work with <a title="Gentoo" href="http://www.gentoo.org" target="_blank">Gentoo</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henrikfalk.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henrikfalk.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henrikfalk.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henrikfalk.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henrikfalk.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henrikfalk.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henrikfalk.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henrikfalk.wordpress.com/235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=henrikfalk.wordpress.com&amp;blog=7797636&amp;post=235&amp;subd=henrikfalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://henrikfalk.wordpress.com/2009/06/16/microsoft-virtual-pc-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7cef6e3ece376e87a6196d07c10545?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">henrikfalk</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/mvpcstart8.jpg" medium="image">
			<media:title type="html">mvpcstart</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/options.jpg" medium="image">
			<media:title type="html">options</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/nameandlocation.jpg" medium="image">
			<media:title type="html">nameandlocation</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/operatingsystem.jpg" medium="image">
			<media:title type="html">operatingsystem</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/ram.jpg" medium="image">
			<media:title type="html">ram</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/newvhd.jpg" medium="image">
			<media:title type="html">newvhd</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/vhdsize.jpg" medium="image">
			<media:title type="html">vhdsize</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/mvpcw2003.jpg" medium="image">
			<media:title type="html">mvpcw2003</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/mvpnetworking.jpg" medium="image">
			<media:title type="html">mvpnetworking</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/mvpcsharedfolders.jpg" medium="image">
			<media:title type="html">mvpcsharedfolders</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/firstboot1.jpg" medium="image">
			<media:title type="html">firstboot</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/captureisoimage.jpg" medium="image">
			<media:title type="html">captureisoimage</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/reset.jpg" medium="image">
			<media:title type="html">reset</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/windowsinstall.jpg" medium="image">
			<media:title type="html">windowsinstall</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/ctraltdelete.jpg" medium="image">
			<media:title type="html">ctraltdelete</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/vmainstall.jpg" medium="image">
			<media:title type="html">vmainstall</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/sharefolder.jpg" medium="image">
			<media:title type="html">sharefolder</media:title>
		</media:content>

		<media:content url="http://henrikfalk.files.wordpress.com/2009/06/sharefolderbrowse.jpg" medium="image">
			<media:title type="html">sharefolderbrowse</media:title>
		</media:content>
	</item>
	</channel>
</rss>
