<?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>Code, coke and coins &#187; Development</title>
	<atom:link href="http://www.atomic14.co.uk/blog/archives/category/develop/feed" rel="self" type="application/rss+xml" />
	<link>http://www.atomic14.co.uk/blog</link>
	<description>Occassional murmurs from your average software developer</description>
	<lastBuildDate>Sat, 03 Mar 2007 12:11:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASP.NET Viewstate</title>
		<link>http://www.atomic14.co.uk/blog/archives/51</link>
		<comments>http://www.atomic14.co.uk/blog/archives/51#comments</comments>
		<pubDate>Sat, 03 Mar 2007 12:11:41 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/51</guid>
		<description><![CDATA[I was recently musing over the use of ASP.NET&#8217;s viewstate, and had a quick truddle around the web to find something that explained the in and outs of it. I feel compelled to link to this article which I believe is one of the most throughout and better written articles I&#8217;ve seen in a long [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently musing over the use of ASP.NET&#8217;s viewstate, and had a quick truddle around the web to find something that explained the in and outs of it. I feel compelled to link to this <a href="url=http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx">article</a> which I believe is one of the most throughout and better written articles I&#8217;ve seen in a long time.</p>
<p>With, what I believe is, an ever degrading quaility of Microsoft articles and help, we need more articles like this written by individuals who have used the technology.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/51/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More COM capers in Visual Studio 2005</title>
		<link>http://www.atomic14.co.uk/blog/archives/50</link>
		<comments>http://www.atomic14.co.uk/blog/archives/50#comments</comments>
		<pubDate>Sun, 25 Feb 2007 12:49:29 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/50</guid>
		<description><![CDATA[I recently wrote about creating early bound COM objects in .NET, the object (no pun intended) of the exercise was to persuade Visual Studio 2005 to produce an early binable COM object without any &#8216;jiggery pokery&#8217; after the standard build. The exercise proved successful, I could simply &#8216;build&#8217; and start using my COM object from [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote about <a href="http://www.atomic14.co.uk/blog/archives/47">creating early bound COM objects in .NET</a>, the object (no pun intended) of the exercise was to persuade Visual Studio 2005 to produce an early binable COM object without any &#8216;jiggery pokery&#8217; after the standard build. The exercise proved successful, I could simply &#8216;build&#8217; and start using my COM object from my unmanaged code.</p>
<p>However I did run into some issues, the first of which was caused by .NET not initialising it&#8217;s FPU control word when being called from unmanaged code. The issue occured because the unmanaged application I was calling my component from was written in Borland Delphi, which doesn&#8217;t suppress certain floating exceptions in the same was Microsoft does. If I&#8217;d had access to the Delphi source I could have recompiled turning off the exceptions, something like <a href="http://homepages.borland.com/ccalvert/TechPapers/FloatingPoint.html">this</a>.</p>
<p>Here is how to turn them off in C++Builder:<br />
<code>#include float.h<br />
&nbsp;<br />
__fastcall TForm1::TForm1(TComponent* Owner)<br />
&nbsp;&nbsp;&nbsp;&nbsp;: TForm(Owner)<br />
{<br />
&nbsp;&nbsp;_control87(MCW_EM, MCW_EM);<br />
}<br />
</code></p>
<p>Here is how to turn them off in Delphi:<br />
<code>const MCW_EM = DWord($133f);<br />
&nbsp;&nbsp;begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;Set8087CW(MCW_EM);<br />
&nbsp;&nbsp;end;<br />
</code></p>
<p>Of course I&#8217;d have to produce a solution from my component, the easiest implementation I could find for this was to add something to my default constructor of my COMBase class. I started using code to explicitly set the control word, something along these lines&#8230;</p>
<p><code>[DllImport(&quot;msvcrt.dll&quot;, EntryPoint=&quot;_control87&quot;)]<br />
public static extern UInt32 Control87(UInt32 Toggle, UInt32 Mask);<br />
&nbsp;<br />
UInt32 OldControlWord = Control87(0, 0); // Get current value<br />
&nbsp;<br />
Control87(0x9001f, 0xffffffff); // Set to .NET default<br />
// Call Code Here<br />
Control87(OldControlWord, 0xffffffff); // Restore to previous value<br />
</code></p>
<p>Although this works admirably, whilst I was working on it, a much simpler solution was offered to be from another developer, which I  added to my COMBase class.</p>
<p><code>[ComVisible(false)]<br />
&nbsp;&nbsp;&nbsp;&nbsp;public class COMBase <br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public COMBase()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Ensure FPU Control Word is set when called from unmanaged applications.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try { Double.IsNaN(Double.NaN); }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (ArithmeticException) { /* Intentionally empty. .NET will initialise the FPU at this point. */ }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;&nbsp;Snip */<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
</code></p>
<p>With this solved, the only remaining task was distribution of my COM component. For this I added a simple installer component to my code, which would be called from my setup project.</p>
<p><code>[ComVisible(false)]<br />
&nbsp;&nbsp;&nbsp;&nbsp;[RunInstaller(true)]<br />
&nbsp;&nbsp;&nbsp;&nbsp;public partial class CustomInstall : Installer<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public CustomInstall()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public override void Install(IDictionary stateSaver)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.Install(stateSaver);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RegistrationServices regSrv = new RegistrationServices();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regSrv.RegisterAssembly(base.GetType().Assembly, AssemblyRegistrationFlags.SetCodeBase);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public override void Uninstall(IDictionary savedState)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.Uninstall(savedState);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RegistrationServices regSrv = new RegistrationServices();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regSrv.UnregisterAssembly(base.GetType().Assembly);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</code></p>
<p>With the project output added as &#8216;custom actions&#8217; to my setup project, I could simply build my COM component, test it; then build an MSI for distribution which ensured calling of the registration functions, which in turn registered it for COM. It&#8217;s important to note that my components are not flagged for COM registration in the setup project, this is all catered for by the custom code in my installer class and COMBase class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/50/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating early bindable COM objects in .NET 2</title>
		<link>http://www.atomic14.co.uk/blog/archives/47</link>
		<comments>http://www.atomic14.co.uk/blog/archives/47#comments</comments>
		<pubDate>Mon, 22 Jan 2007 18:26:31 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/47</guid>
		<description><![CDATA[Many will ask why do such a daft thing as creating COM objects in .NET? Well the answer is fairly simple, at my current place of work we only have Microsoft Visual Studio 2005 and I needed to create a COM object for compatibility with an older application, which only understood early bound COM. The [...]]]></description>
			<content:encoded><![CDATA[<p>Many will ask why do such a daft thing as creating COM objects in .NET? Well the answer is fairly simple, at my current place of work we only have Microsoft Visual Studio 2005 and I needed to create a COM object for compatibility with an older application, which only understood early bound COM. The application is a &#8216;drag and drop&#8217; business rules and workflow editor, COM can be used to provide additional custom functions otherwise not available.</p>
<p>I thought to myself, this can&#8217;t be that difficult, just follow the tickboxes&#8230;..</p>
<ul>
<li>Project Properties->Application->Assembly Information->Make Assembly COM Visible &#8211; <strong>Check</strong></li>
<li>Project Properties->Build->Register for COM Interop (automatically exports a typelibrary) &#8211; <strong>Check</strong></li>
<li>Project Properties->Signing-> Sign the assembly (make a new strong key name file) &#8211; <strong>Check</strong></li>
</ul>
<p>&#8230;. surely that&#8217;s enough? Wrong. The assembly was a late bound COM object only.</p>
<p>A few help topics and Googles later, I&#8217;m doing all sorts of tricks, adding and deleting things in the GAC and learning the wonders of regasm. However, none of it worked.</p>
<p>Back to basics, the type library defines the interfaces for early binding, so why couldn&#8217;t COM see the type library definitions? The answer turned out to be very simple, the C# complier didn&#8217;t add the required information into the registry during the build. Help was at hand however, in the form of the attributes [ComRegisterFunction] and [ComUnregisterFunction]. It should be noted that the C# build does add partial information to the registry, but not the required TypeLib key&#8230;&#8230;</p>
<p><code><br />
[ComVisible(false)]<br />
public class COMBase<br />
{<br />
 [ComRegisterFunction]<br />
 static void ComRegister(Type t)<br />
 {<br />
&nbsp;&nbsp;string keyName = @&quot;CLSID\&quot; + t.GUID.ToString(&quot;B&quot;);<br />
&nbsp;&nbsp;using (RegistryKey key = <br />
&nbsp;&nbsp;&nbsp;&nbsp; Registry.ClassesRoot.OpenSubKey(keyName, true))<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp; using (RegistryKey subkey =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key.CreateSubKey(&quot;TypeLib&quot;))<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;Guid libid = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marshal.GetTypeLibGuidForAssembly(t.Assembly);<br />
&nbsp;&nbsp;&nbsp;&nbsp;subkey.SetValue(&quot;&quot;, libid.ToString(&quot;B&quot;));<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp; using (RegistryKey subkey = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key.CreateSubKey(&quot;Version&quot;))<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp; Version ver = t.Assembly.GetName().Version;<br />
&nbsp;&nbsp;&nbsp;&nbsp; string version = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string.Format(&quot;{0}.{1}&quot;, ver.Major, ver.Minor);<br />
&nbsp;&nbsp;&nbsp;&nbsp; subkey.SetValue(&quot;&quot;, version);<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp;}<br />
 }<br />
&nbsp;<br />
 [ComUnregisterFunction]<br />
 static void ComUnregister(Type t)<br />
 {<br />
&nbsp;&nbsp;string keyName = @&quot;CLSID\&quot; + t.GUID.ToString(&quot;B&quot;);<br />
&nbsp;&nbsp;Registry.ClassesRoot.DeleteSubKeyTree(keyName);<br />
 }<br />
}<br />
</code></p>
<p>Volia, derive all my &#8216;COM&#8217; classes from &#8216;COMBase&#8217; and I have a working early binable COM object. Should also mention, none of the GAC and regasm manual processing is needed either. Not particulary neat, I would certainly like to know if there&#8217;s a better way.</p>
<p>As an aside, during my time with COM in .NET I picked up a few pointers on &#8216;best practices&#8217; the most useful of which is using defined interfaces, with fixed GUIDs to keep the resultant COM &#8216;backwards compatible&#8217;.</p>
<p>For example:-</p>
<p><code><br />
[Guid(&quot;89B65A92-5CE6-4295-A6DF-9506530C7877&quot;)]<br />
[InterfaceType(ComInterfaceType.InterfaceIsDual)]<br />
public interface IFoo<br />
{<br />
 int Bar();<br />
}<br />
&nbsp;<br />
[ProgId(&quot;MyCOMObject.Foo&quot;)]<br />
[ClassInterface(ClassInterfaceType.None)]<br />
public class Foo : COMBase, IFoo<br />
{<br />
 public int Bar()<br />
 {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return 42;<br />
 }<br />
}<br />
</code></p>
<p>Should also be noted that explicitly specifiying the COM &#8216;ProgID&#8217; makes it easier to manage also (and elminates the need to shorten namespaces and class names for COM). Specifiying &#8216;ClassInterfaceType.None&#8217; for the class effectively hides it from COM, leaving only the parts you want to explicitly expose in the interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/47/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Things I&#8217;d forgotten you could do with VB6</title>
		<link>http://www.atomic14.co.uk/blog/archives/41</link>
		<comments>http://www.atomic14.co.uk/blog/archives/41#comments</comments>
		<pubDate>Thu, 29 Jun 2006 19:29:39 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/41</guid>
		<description><![CDATA[My last 2 jobs have involved a large amount of Visual Basic 6 development (amongst T_SQL, C and various script languages), but have been very different in terms of design and implementation of code.
Prior to my current role, the VB6 code was about as cutting-edge as you can get with an 8 year old development [...]]]></description>
			<content:encoded><![CDATA[<p>My last 2 jobs have involved a large amount of Visual Basic 6 development (amongst T_SQL, C and various script languages), but have been very different in terms of design and implementation of code.</p>
<p>Prior to my current role, the VB6 code was about as cutting-edge as you can get with an 8 year old development environment. Extensive use was made of collections, classes and COM to build a robust central object library that was a breeze to use.</p>
<p>By comparision, the product I&#8217;m working with currently has &#8216;history&#8217;, and a lot of it. The only time a class is used is to provide a public interface to an ActiveX control. By and large the majority of the &#8216;framework&#8217; is implemented in shared modules.</p>
<p>Neither way is the &#8216;right&#8217; way, both are valid in VB6, one being an object oriented approach and the other very much &#8216;procedural&#8217;. That said it is difficult moving back to procedural programming after writing so much object oriented code.</p>
<p>It&#8217;s the procedural code, having been around as long as VB6 itself, that threw up a few surprises for me. Along with the fact that several contributers had their roots in VB to the early versions. That said I don&#8217;t remember using some of these features, even way back in VB3&#8230;..</p>
<p><em>Multiple executions on one line of code</em><br />
<code>foo=1:bar=1</code></p>
<p><em>GoSubs!</em><br />
<code>Private Sub Foo()<br />
&nbsp;&nbsp;&nbsp;&nbsp;GoSub Bar<br />
Exit Sub<br />
Bar:<br />
&nbsp;&nbsp;&nbsp;&nbsp;MsgBox &quot;Hello world!&quot;<br />
Return<br />
End Sub</code></p>
<p><em>Option Compare*</em><br />
<code>Option Compare Text</code></p>
<p>&#8230;and an interesting technique to detect a VB program was running interpreted&#8230;..</p>
<p><code>Debug.Print 1/0</code></p>
<p>&#8230;I&#8217;d always for some reason used Debug.Assert to call a function and set a value. I&#8217;m sure both techniques have their pros and cons.</p>
<p>* Not strictly &#8216;forgotten&#8217;, just never used, the default binary has always suited.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/41/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Visual Studio 2005 Express Editions</title>
		<link>http://www.atomic14.co.uk/blog/archives/40</link>
		<comments>http://www.atomic14.co.uk/blog/archives/40#comments</comments>
		<pubDate>Sun, 04 Jun 2006 18:22:50 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/40</guid>
		<description><![CDATA[Recently I finally took the plunge and installed the express editions of Visual Studio 2005 on one of my machines. The whole process was very painless I must say, the whole process of installing VC, VCS, VB and SQL 2005 didn&#8217;t require a single reboot, and didn&#8217;t present any installation options at all. It&#8217;s worth [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I finally took the plunge and installed the <a href="http://msdn.microsoft.com/vstudio/express/">express editions of Visual Studio 2005</a> on one of my machines. The whole process was very painless I must say, the whole process of installing VC, VCS, VB and SQL 2005 didn&#8217;t require a single reboot, and didn&#8217;t present any installation options at all. It&#8217;s worth noting that many tools don&#8217;t install with Express Editions, however these too are a free download within the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC&#038;displaylang=en">.NET Framework 2.0 SDK</a>.</p>
<p>Happily the whole kit and caboodle seems to run along side old versions of development tools, such as Visual Studio 6 and SQL 2000 etc without any gripes.</p>
<p>I was eager to gain some &#8216;hands-on&#8217; with C#.NET and VB.NET, which for all intensive purposes seemed pretty easy to grasp. Exception handling is a bit of a revelation if coming from a VB6 background, which is where most of my &#8216;commercial&#8217; day-to-day work happens, who said VB6 was dead?</p>
<p>Aside from looking at the .NET 2.0, I was also particulary interested in Visual C++, being the last language that is now able to compile native applications (VB is .NET only). Herein lay my first dissappointment with the Express package, support for native applications in C++ appears to be limited to console applications only. I can&#8217;t knock Microsoft for &#8217;steering&#8217; developers towards .NET, especially after providing such a rich free development environment, but as much as I don&#8217;t want to commercially write VB6 forever I also don&#8217;t want to always write .NET applications.</p>
<p>You <em>can</em> get halfway to a working Win32 native application development enviroment by following Microsoft instructions <a href="http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/">here</a> and/or <a href="http://msdn2.microsoft.com/en-us/library/ms235626.aspx">here</a>. But, and its a big but, at the end of the day you cannot edit resources in Visual C++ 2005 Express. You are left with a very nice development environment for the Platform SDK, albeit without integrated GUI support.</p>
<p>This is a great shame, it leaves the Express Editions in a strange place &#8211; somewhere between something too complex for a complete &#8216;rookie&#8217; programmer, and something not quite useful enough for a more experienced one. Unless of course you are fully on the .NET bandwagon, in which case it&#8217;s probably very difficult to justify buying the full product for use purely at home.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCAD</title>
		<link>http://www.atomic14.co.uk/blog/archives/39</link>
		<comments>http://www.atomic14.co.uk/blog/archives/39#comments</comments>
		<pubDate>Mon, 22 May 2006 17:35:00 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/39</guid>
		<description><![CDATA[I&#8217;ve finally taken the plunge into the wonderful world of Microsoft Certification, having signed up for an horrendously expensive course for MCAD (Microsoft Certified Application Developer), and hopefully extend this to an MCSD at a later date. I had considered the books &#038; exams only route, but it&#8217;s very tedious just sifting through a book, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally taken the plunge into the wonderful world of Microsoft Certification, having signed up for an horrendously expensive course for MCAD (Microsoft Certified Application Developer), and hopefully extend this to an MCSD at a later date. I had considered the books &#038; exams only route, but it&#8217;s very tedious just sifting through a book, some sort of training structure was in order.</p>
<p>The course will initially comprise of:-</p>
<ul>
<li>2555 &#8211; Developing Microsoft .NET Applications for Windows (Visual C# .NET)</li>
<li>2389 &#8211; Programming with Microsoft ADO.NET<br />
(Exam 70-316 &#8211; Developing and Implementing Windows-based Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET)</li>
<li>2310 &#8211; Developing Microsoft ASP.NET Web Applications Using Visual Studio .NET<br />
(Exam 70-315 &#8211; Developing and Implementing Web Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET)</li>
<li>2524 &#8211; Developing XML Web Services Using Microsoft ASP.NET</li>
<li>2557 &#8211; Building COM+ Applications Using Microsoft .NET Enterprise Services<br />
(Exam 70-320 &#8211; Developing XML Web Services and Server Components with Microsoft Visual C# .NET and the Microsoft .NET Framework)</li>
</ul>
<p>I&#8217;m taking the C# route, although I&#8217;ll probably end up taking the Visual Basic exam also, just to broaden my knowledge.</p>
<p>You may ask why bother with the certification at all, after all I have 15+ years experience in C, C++, Visual Basic, Pascal and others. It&#8217;s more of a personal achievement thing, and a &#8216;I told you so&#8217; more than anything else. I&#8217;ve also never been in the fortunate position of working for a company willing to provide any formal training.</p>
<p>I did have a preliminary look at some of the course material, and found it rather easy. I do honestly hope I will learn &#8217;something&#8217; from this, after all that is the idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/39/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Daily WTF</title>
		<link>http://www.atomic14.co.uk/blog/archives/37</link>
		<comments>http://www.atomic14.co.uk/blog/archives/37#comments</comments>
		<pubDate>Sat, 13 May 2006 18:02:47 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/37</guid>
		<description><![CDATA[I&#8217;ve recently been steered towards a wonderful website called The Daily WTF which is maintained by Alex Papadimoulis. The site contains some of the most hilarious code you are ever likely to read, a lot of which is accredited with being source from &#8216;Enterprise level&#8217; commercial packages.
It really is a site that every programmer should [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been steered towards a wonderful website called <a href="http://thedailywtf.com">The Daily WTF</a> which is maintained by Alex Papadimoulis. The site contains some of the most hilarious code you are ever likely to read, a lot of which is accredited with being source from &#8216;Enterprise level&#8217; commercial packages.</p>
<p>It really is a site that every programmer should be conversant with, and should you find any of your code published there, you might think about a career change.</p>
<p>That said, I&#8217;ll leave you with a short snippet of a bizzare line of code that I somehow managed not so long ago&#8230;..</p>
<p><code>If iif(IsNull(rs!id, -1, rs!id)) = -1 Then &#46;..</code></p>
<p>&#8230; hopefully this proves we are all fallible ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/37/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing ADO Connection objects between processes</title>
		<link>http://www.atomic14.co.uk/blog/archives/34</link>
		<comments>http://www.atomic14.co.uk/blog/archives/34#comments</comments>
		<pubDate>Mon, 27 Mar 2006 18:07:32 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/34</guid>
		<description><![CDATA[I was posed an interesting problem today, a colleague was debugging some Visual Basic 6 code, and coming across the following error:-
&#8220;Run-time error &#8216;3001&#8242;: The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.&#8221;
The error was occuring when assigning the &#8216;ActivateConnection&#8217; property:-

Public [...]]]></description>
			<content:encoded><![CDATA[<p>I was posed an interesting problem today, a colleague was debugging some Visual Basic 6 code, and coming across the following error:-</p>
<p>&#8220;Run-time error &#8216;3001&#8242;: The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.&#8221;</p>
<p>The error was occuring when assigning the &#8216;ActivateConnection&#8217; property:-</p>
<p><code><br />
Public Function MyFunc(objConn as ADODB.Connection) as Boolean<br />
&nbsp;<br />
Dim objCmd as New ADODB.Command<br />
&nbsp;<br />
Set objCmd.ActiveConnection = objConn<br />
</code></p>
<p>Nearing the end of a seemingly fruitless search for the answer (it would seem error 3001 occurs for all sorts of reasons), the answer was stumbled upon.</p>
<p>The connection object was being created in an EXE and being passed to the function in a DLL, herein lay the problem. Apparently, you cannot pass an ADODB connection object between processes. This is the reason it ran correctly when complied, as the DLL became part of the EXEs process, when debugging in Visual Basic two distinct processes existed.</p>
<p>As with all obsure problems like this, there was a simple and elegant workaround. That is to simply debug the EXE and DLL in a Visual Basic group file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;DLL Hell&#8217; Strikes Again, GUIDs, IIDs and binding.</title>
		<link>http://www.atomic14.co.uk/blog/archives/31</link>
		<comments>http://www.atomic14.co.uk/blog/archives/31#comments</comments>
		<pubDate>Mon, 20 Mar 2006 19:19:25 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/31</guid>
		<description><![CDATA[I remember all too well wrestling with all sorts of versions of system DLLs under Win3.1. Even resorting to dynamic loads and &#8216;GetProcAddress&#8217; to determine exactly what my program might be about to do. I thought it was all in the past&#8230;..
I&#8217;ve been beavering away with a smallish development team developing a new product which, [...]]]></description>
			<content:encoded><![CDATA[<p>I remember all too well wrestling with all sorts of versions of system DLLs under Win3.1. Even resorting to dynamic loads and &#8216;GetProcAddress&#8217; to determine exactly what my program might be about to do. I thought it was all in the past&#8230;..</p>
<p>I&#8217;ve been beavering away with a smallish development team developing a new product which, for compatiblity reasons with the &#8216;host&#8217; application, is developed as ActiveX DLLs using Visual Basic 6. To date there are about 14 individual ActiveX DLLs and other files that make up the product.</p>
<p>Of course we have source control, without which the synchronisation and rapid development pace would be impossible.</p>
<p>A problem occured today with one of the &#8216;central&#8217; dependency ActiveX DLLs we have developed, a mini .NET library if you will. It is flagged to build as binary compatible and all other ActiveX DLLs early-bind to it. Fair enough you may think. </p>
<p>But what if due to limitations of working with source control, the &#8216;compatible DLL&#8217; is in a sub folder of the main project and isn&#8217;t updated as frequently as maybe it should be. As it happens, part of the interface (IID) that wasn&#8217;t in the &#8216;compatible DLL&#8217; changed between versions. Let DLL hell ensue&#8230;&#8230;</p>
<p>The only viable solution was to break compatibility completely and &#8216;re-bind&#8217; all dependant DLLs to the new GUID.</p>
<p>Considering the &#8216;master build&#8217; of the product is done in reverse order, that is dependancies first, it begs the question of whether binary compatibility is really worth the effort anyway. &#8216;Project Compatiblity&#8217; would preserve the GUIDs and therefore early-binds, any changes to the classes/methods of the central DLL could be tracked via source control, so the correct developer could be thumped should any change produce &#8216;real&#8217; incompatibilty anyway.</p>
<p>Of course there&#8217;s always someone that will pipe up about the advantages of late binding, but for the purpose scale and speed of this project early binding is almost essential.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webserver On A Stick</title>
		<link>http://www.atomic14.co.uk/blog/archives/29</link>
		<comments>http://www.atomic14.co.uk/blog/archives/29#comments</comments>
		<pubDate>Sun, 05 Mar 2006 00:39:09 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PlusNet]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/29</guid>
		<description><![CDATA[Every now and again some bright spark comes up with a simple idea that really does rock.
Like many people I&#8217;m sure, I work on Windows 99% of the time. However much you want to knock Microsoft, it really is still the platform of choice for most purposes. In my case, I&#8217;ve little choice anyway, it [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and again some bright spark comes up with a simple idea that really does rock.</p>
<p>Like many people I&#8217;m sure, I work on Windows 99% of the time. However much you want to knock Microsoft, it really is still the platform of choice for most purposes. In my case, I&#8217;ve little choice anyway, it is the platform for which I develop software.</p>
<p>Also like many people, I have a website and the same as many ISPs, my ISP <a href="http://portal.plus.net/my/mydiscount_info/landing_page.html?WRKUh%2Fz%2FuZ5dXmEjImm%2BIMkRiDrJhibK68I95EISja8%3D">PlusNet</a> offer a package comprising of something other than Windows based webserver software, namely the all too common Apache, PHP, MySQL combination.</p>
<p>This is a complete pain, this &#8216;alien&#8217; software package is very good for developing dynamic websites etc, but the problem is how to develop and test them locally, i.e. on your PC before publishing them to the big wide world of the internet. Of course you can download Windows &#8216;flavours&#8217; of all these packages, and spend another week configuring them.</p>
<p>Or you can download <a href="http://www.chsoftware.net/en/useware/wos/wos.htm">Webserver On A Stick</a>.</p>
<p>As I started out, yes it&#8217;s a simple idea. Bundle Apache, PHP and MySQL, add a front end control program and away you go. Of course the author&#8217;s original intention was to produce a minimal footprint webserver environment for use on a USB stick, however there is nothing to stop you running it off your local hard drive. Simply unzip the package, and throw your website at it&#8217;s &#8216;www&#8217; folder and away you go.</p>
<p>It&#8217;s certainly something I wish I&#8217;d found sooner, according to the copyright notice it started in 2003, maybe if more people shout about it, more will find this remarkably useful little piece of software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/29/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
