<?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>ClixieTrax &#187; Delphi</title>
	<atom:link href="http://www.clixiesoft.com/category/programming/delphi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clixiesoft.com</link>
	<description>My bit by bit daily journey</description>
	<lastBuildDate>Mon, 26 Apr 2010 09:41:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XP Manifest &amp; Tee Chart</title>
		<link>http://www.clixiesoft.com/2009/02/xp-manifest-tee-chart/</link>
		<comments>http://www.clixiesoft.com/2009/02/xp-manifest-tee-chart/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 15:55:11 +0000</pubDate>
		<dc:creator>Teddy Darmadi</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.clixiesoft.com/?p=88</guid>
		<description><![CDATA[It&#8217;s been several years since I had this stupid bug. I made a program using Delphi 6 that uses TeeChart. The program works fine.
Several months later, I changed platform to using Delphi 7. I&#8217;ve installed TQReport and TQRChart (TeeChart) into Delphi 7 (Since QReport is no longer installed by default in Delphi 7). The program [...]]]></description>
			<content:encoded><![CDATA[<p><span>It&#8217;s been several years since I had this stupid bug. I made a program using Delphi 6 that uses TeeChart. The program works fine.</span></p>
<p><span>Several months later, I changed platform to using Delphi 7. I&#8217;ve installed TQReport and TQRChart (TeeChart) into Delphi 7 (Since QReport is no longer installed by default in Delphi 7). The program works fine.</span></p>
<p><span>Then I decided to add some graphical theme into the software. It works fine too, unless my client finally notices a bug. The program will immediately generate a Stack Overflow when my program prints more than one graphical report.</span></p>
<p><span>The funny thing is, it fail to work on most computer (including my PC!), but one; the one that has the Windows Classic theme.</span></p>
<p><span>My first guess would be my graphical enhancement. But after I double check, I am using nothing but merely TImage all around the place. That bug must come from somewhere else.</span></p>
<p><span>Months go by, and I still couldn&#8217;t found the remedy for that problem, until I accidentally found an interesting article in the internet: XPManifest and TeeChart will generate a Stack Overflow.</span></p>
<p><span>Surprised, I checked my program again. Yes, it definitely uses the advantage of XPManifest. Guess what, after removing the manifest, I am free of that stupid bug. (Along with the good XP controls&#8230;, sigh)</span></p>
<p><span>Then again, I still don&#8217;t understand why that Stack Overflow occurs when XPManifest and TeeChart goes together&#8230; Oh well <img src='http://www.clixiesoft.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clixiesoft.com/2009/02/xp-manifest-tee-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QuickReport in Delphi 7</title>
		<link>http://www.clixiesoft.com/2008/11/quickreport-in-delphi-7/</link>
		<comments>http://www.clixiesoft.com/2008/11/quickreport-in-delphi-7/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 19:35:35 +0000</pubDate>
		<dc:creator>Teddy Darmadi</dc:creator>
				<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.clixiesoft.com/?p=85</guid>
		<description><![CDATA[Just in case you don&#8217;t know that QuickReport is not included on Delphi 7 installation, here&#8217;s how to enable QuickReport:

Open Delphi
Click Components -&#62; Install Package
A component window will open. Click Add&#8230;
Browse to Delphi7\bin and locate dclqrt70.bpl (QuickReport), dcltqr70.bpl (TeeChart for QuickReport), dcltee70.bpl (TeeChart)
Click OK and you&#8217;re set.

Notice that the QuickReport component tab is now available.
Update: [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case you don&#8217;t know that QuickReport is not included on Delphi 7 installation, here&#8217;s how to enable QuickReport:</p>
<ol>
<li>Open Delphi</li>
<li>Click Components -&gt; Install Package</li>
<li>A component window will open. Click Add&#8230;</li>
<li>Browse to Delphi7\bin and locate dclqrt70.bpl (QuickReport), dcltqr70.bpl (TeeChart for QuickReport), dcltee70.bpl (TeeChart)</li>
<li>Click OK and you&#8217;re set.</li>
</ol>
<p>Notice that the QuickReport component tab is now available.</p>
<p><span style="color: #ff0000;">Update</span>: I forgot to add two additional Package, the TeeChart for QuickReport and TeeChart, that will be required to use QRChart capability.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clixiesoft.com/2008/11/quickreport-in-delphi-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing TWebBrowser with TMozillaBrowser</title>
		<link>http://www.clixiesoft.com/2008/08/replacing-twebbrowser-with-tmozillabrowser/</link>
		<comments>http://www.clixiesoft.com/2008/08/replacing-twebbrowser-with-tmozillabrowser/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 10:35:22 +0000</pubDate>
		<dc:creator>Teddy Darmadi</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.clixiesoft.com/?p=53</guid>
		<description><![CDATA[One thing that keeps me worried when installing a web based application in my client&#8217;s computer is the browser dependency. There&#8217;s usually something going wrong when porting my web application from my stable development environment to the client&#8217;s.
Sometimes a visit to the client&#8217;s computer is like opening a birthday present. We don&#8217;t know for sure [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that keeps me worried when installing a web based application in my client&#8217;s computer is the browser dependency. There&#8217;s usually something going wrong when porting my web application from my stable development environment to the client&#8217;s.</p>
<p>Sometimes a visit to the client&#8217;s computer is like opening a birthday present. We don&#8217;t know for sure whether the inside is good, useless, or full of crap. Various clients prefer various browsers, which generally result in either my CSS isn&#8217;t supported, some plug-ins reject my script, using a very old version of Internet Explorer, the screen is less than 1024&#215;768 and we couldn&#8217;t find the video driver, or worse, all combined.</p>
<p>There are some alternatives:</p>
<ol>
<li>Making sure the client is using the exact same browser. This means the user cannot use their favorite browser anymore.</li>
<li>Develop compatible software to all browser types there is. Quite another troublesome way, since the development cost and time will rise significantly. Not mentioning the user might try to upgrade to a different upcoming browser.</li>
<li>Develop your own browser. TWebBrowser unit is good, but remembering it is using internet explorer engine, we cannot be certain which version is compatible.</li>
</ol>
<p>The third option sounds valuable. But instead of TWebBrowser, we&#8217;ll be using TMozillaBrowser to develop our own browser using <a href="http://www.iol.ie/~locka/mozilla/mozilla.htm" target="_blank">Mozilla ActiveX Control</a>. The details can be found <a href="http://www.paranoia.clara.net/articles/taming_the_lizard_with_delphi.html" target="_blank">here</a>.</p>
<p><strong>How do we do that </strong></p>
<p>Here&#8217;s a step by step solution:<span id="more-53"></span></p>
<ol>
<li>Download and install <a href="http://www.iol.ie/~locka/mozilla/mozilla.htm" target="_blank">Mozilla ActiveX Control</a>.</li>
<li>Run Delphi (in this case, I&#8217;m using Delphi 7)</li>
<li>Component -&gt; Import ActiveX Control -&gt; Choose Mozilla Control 1.0 Type Library (Version 1.0)</li>
<li>If the component isn&#8217;t there, you have to register the DLL first by running <code>regsvr32 mozctlx.dll</code> at the command prompt.<code><br />
</code></li>
<li>Click Install. A new component will appear at ActiveX tab.</li>
</ol>
<p>That&#8217;s all there&#8217;s to it. Using the component is pretty much the same with TWebBrowser, albeit the green color and its inability to resize at design time are pretty annoying. The latter one can be resolved by dropping the component into a TPanel, setting the Align to alClient. You can now resize the panel.</p>
<p>I&#8217;m still trying to communicate the browser with the JavaScript inside the web application though. This can be quite a hard work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clixiesoft.com/2008/08/replacing-twebbrowser-with-tmozillabrowser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JCL &amp; JVCL Installation</title>
		<link>http://www.clixiesoft.com/2008/08/jcl-jvcl-installation/</link>
		<comments>http://www.clixiesoft.com/2008/08/jcl-jvcl-installation/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 10:04:28 +0000</pubDate>
		<dc:creator>Teddy Darmadi</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.clixiesoft.com/?p=46</guid>
		<description><![CDATA[I found a website link when crawling the web, named JEDI Visual Component Library. Somehow I believe the initiator of this project is a big fans of StarWars. Maybe it’s just me.
It’s a collection of great components for Delphi, which lead me to believe I found a treasure.
After I downloaded the ZIP file, I read [...]]]></description>
			<content:encoded><![CDATA[<p>I found a website link when crawling the web, named <a title="JVCL Homepage" href="http://homepages.codegear.com/jedi/jvcl/" target="_blank">JEDI Visual Component Library</a>. Somehow I believe the initiator of this project is a big fans of <a href="http://www.starwars.com" target="_blank">StarWars</a>. Maybe it’s just me.</p>
<p>It’s a collection of great components for Delphi, which lead me to believe I found a treasure.</p>
<p>After I downloaded the ZIP file, I read the manual carefully but cannot found an instruction of installation. No, installing the DPK itself is useless.</p>
<p>I did spotted an install.bat file, but I can’t make it work.</p>
<p>After some googling events, I saw a light of hope, and managed to install it successfully. I’ll describe them in a very short steps:</p>
<ol>
<li>Download the package (Duh!). I was downloading the version 3.33, but after some time, they launch the 3.34. The file should be named <strong>JVCL333CompleteJCL1101-build2725.7z </strong> with the 333 part as the version number.</li>
<li>Decompress this file (You might need a <a title="7z.org" href="http://www.7z.org" target="_blank">7z unpacker</a> for this) into <strong><em>{Your Delphi Directory}</em>\Source</strong>. This is the reason why I can’t install the package. I was extracting these files into <strong>\Lib</strong> directory.</li>
<li>Run install.bat in the JCL folder. This will compile and run the installer. I guess the JEDI team does a great job huh?</li>
<li>The installer will show you all your available Delphi version.<br />
<a href="http://www.clixiesoft.com/wp-content/uploads/2008/08/jclinstall.jpg" rel="lightbox[46]"><img class="alignnone size-medium wp-image-50" title="JCL Install Screen" src="http://www.clixiesoft.com/wp-content/uploads/2008/08/jclinstall-300x230.jpg" alt="" width="300" height="230" /></a></li>
<li>Install the JCL.</li>
<li>Repeat step 3 for JVCL folder, this time the installer will be a little bit different, but you&#8217;ll get the grip.<br />
<a href="http://www.clixiesoft.com/wp-content/uploads/2008/08/jvclinstall.jpg" rel="lightbox[46]"><img class="alignnone size-medium wp-image-51" title="JVCL Install Screen" src="http://www.clixiesoft.com/wp-content/uploads/2008/08/jvclinstall-300x228.jpg" alt="" width="300" height="228" /></a></li>
<li>Run Delphi. You should see lots of component tabs appear.</li>
</ol>
<p>I&#8217;m still trying to figure out how to use them in my projects. Maybe I&#8217;ll add more entries after I learned some.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clixiesoft.com/2008/08/jcl-jvcl-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a Splash Screen</title>
		<link>http://www.clixiesoft.com/2008/07/making-a-splash-screen/</link>
		<comments>http://www.clixiesoft.com/2008/07/making-a-splash-screen/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 16:22:23 +0000</pubDate>
		<dc:creator>Teddy Darmadi</dc:creator>
				<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.clixiesoft.com/?p=36</guid>
		<description><![CDATA[I’m using splash screen for quite a while. But to realize I’m doing it in a very wrong way is another.
I usually used my Splash Screen as the main form (Since it’s the first one to show up). The problem is I can’t CLOSE it (by doing that will also close the application), and I [...]]]></description>
			<content:encoded><![CDATA[<p>I’m using splash screen for quite a while. But to realize I’m doing it in a very wrong way is another.</p>
<p>I usually used my Splash Screen as the main form (Since it’s the first one to show up). The problem is I can’t CLOSE it (by doing that will also close the application), and I looked like a totally script kiddies when my code is published. Only God knows what kind of mayhem I produced by using such technique.</p>
<p><a href="http://www.klik-kanan.com/delphi/splash_screen.shtml">Here</a>’s how to make a better (and professional) splash screen <img src='http://www.clixiesoft.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.clixiesoft.com/2008/07/making-a-splash-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Object Creation</title>
		<link>http://www.clixiesoft.com/2008/07/dynamic-object-creation/</link>
		<comments>http://www.clixiesoft.com/2008/07/dynamic-object-creation/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 18:48:28 +0000</pubDate>
		<dc:creator>Teddy Darmadi</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.clixiesoft.com/?p=20</guid>
		<description><![CDATA[It&#8217;s been days since I&#8217;m working on a bug which always generates Access Violation errors.

By slicing and analyzing the pattern, this error always occurs when I&#8217;m trying to Free and NIL an object. I&#8217;m pretty much confident for the array index, so it should not be the reason for this error.

procedure FreeButtons&#40;Buttons: TButtons&#41;;
var
  Cnt [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been days since I&#8217;m working on a bug which always generates Access Violation errors.</p>
<p><a href="http://www.clixiesoft.com/wp-content/uploads/2008/07/av.jpg" rel="lightbox[20]"><img class="aligncenter size-medium wp-image-27" title="av" src="http://www.clixiesoft.com/wp-content/uploads/2008/07/av.jpg" alt="" width="300" height="58" /></a></p>
<p>By slicing and analyzing the pattern, this error always occurs when I&#8217;m trying to Free and NIL an object. I&#8217;m pretty much confident for the array index, so it should not be the reason for this error.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> FreeButtons<span style="color: #000066;">&#40;</span>Buttons<span style="color: #000066;">:</span> TButtons<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">var</span>
  Cnt <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">integer</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
  <span style="color: #000000; font-weight: bold;">for</span> Cnt <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">Low</span><span style="color: #000066;">&#40;</span>Buttons<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #000066;">High</span><span style="color: #000066;">&#40;</span>Buttons<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">begin</span>
    <span style="color: #000066;">FreeAndNil</span><span style="color: #000066;">&#40;</span>Buttons<span style="color: #000066;">&#91;</span>Cnt<span style="color: #000066;">&#93;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
  <span style="color: #000066;">SetLength</span><span style="color: #000066;">&#40;</span>Buttons<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>This error appears after I ported my old <a href="http://en.wikipedia.org/wiki/Single_document_interface">SDI</a> framework into an <a href="http://en.wikipedia.org/wiki/Multiple_document_interface">MDI</a> one. It works perfectly fine earlier, but now definitely gives me some headache. I vaguely presume the reason behind this is the component ownership, but I still hasn&#8217;t convinced yet.</p>
<p>Then I stumbled on an article at <a href="http://delphi.about.com/od/kbcurt/a/dynamiccreation.htm">http://delphi.about.com/od/kbcurt/a/dynamiccreation.htm</a> about <em>dynamic object creation</em>. This article point out that if we&#8217;re going to free an object later, we should assign NIL as its parent.</p>
<p><span id="more-20"></span></p>
<h2>Conclusion</h2>
<p>So I finally came down to a conclusion and know exactly why the application always point to a non-readable address. It&#8217;s simply because when I&#8217;m destroying a form, the dynamically created components were <strong>also destroyed</strong> as well! This feature should not be a problem on its own, but when adding up the array index (which obviously not getting reset when the form destroyed) into account, problem occurs.</p>
<p>The workaround for this solution is to destroy the component myself, and set the value to nil.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">FreeButtons<span style="color: #000066;">&#40;</span>SES_Buttons_Category<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
FreeButtons<span style="color: #000066;">&#40;</span>SES_Buttons_Subcategory<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">1</span> <span style="color: #000000; font-weight: bold;">to</span> MAX_ORDER <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">begin</span>
  <span style="color: #000000; font-weight: bold;">for</span> J <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> MAX_OPTION <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">begin</span>
    FreeSpeedButtons<span style="color: #000066;">&#40;</span>SES_OR<span style="color: #000066;">.</span><span style="color: #006600;">Data</span><span style="color: #000066;">&#91;</span>I<span style="color: #000066;">&#93;</span><span style="color: #000066;">.</span><span style="color: #006600;">Options</span><span style="color: #000066;">&#91;</span>J<span style="color: #000066;">&#93;</span><span style="color: #000066;">.</span><span style="color: #006600;">Buttons</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p><strong><span style="color: #00ff00;">Case Closed</span></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clixiesoft.com/2008/07/dynamic-object-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
