<?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>Wizard Software - All things Delphi (and some PHP) &#187; graabr</title>
	<atom:link href="http://wizard-soft.com/blog/category/graabr/feed/" rel="self" type="application/rss+xml" />
	<link>http://wizard-soft.com/blog</link>
	<description>Delphi, Pascal, PHP, programming and (Wizard) Software</description>
	<lastBuildDate>Tue, 01 Dec 2009 06:36:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Firefox Addons, XUL, XPCOM, Delphi and a few headaches</title>
		<link>http://wizard-soft.com/blog/2009/11/30/firefox-addons-xul-xpcom-delphi-and-a-few-headaches/</link>
		<comments>http://wizard-soft.com/blog/2009/11/30/firefox-addons-xul-xpcom-delphi-and-a-few-headaches/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 12:40:00 +0000</pubDate>
		<dc:creator>Softy</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[graabr]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[XPCOM]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://wizard-soft.com/blog/?p=151</guid>
		<description><![CDATA[I wanted to share some information on creating Firefox addons/extensions (or however you care to refer to them). Not any old Firefox addons but XPCOM addons. It&#8217;s taken a couple of weeks of evening work to turn my Graabr Delphi application (www.graabr.com) into a Firefox Addon. Why bother?  Audience, I guess.
Anyhow, creating a non-XPCOM addon [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to share some information on creating Firefox addons/extensions (or however you care to refer to them). Not any old Firefox addons but XPCOM addons. It&#8217;s taken a couple of weeks of evening work to turn my Graabr Delphi application (<a href="http://graabr.com">www.graabr.com</a>) into a Firefox Addon. Why bother?  Audience, I guess.</p>
<p>Anyhow, creating a non-XPCOM addon using javascript is relatively straightforward. But, an XPCOM is a different story. You need some Delphi-friendly Firefox header files which do not appear up-to-date. You also need a whole lot of patience. I found lots of snippets of info on Delphi XPCOM, but most &#8216;answers&#8217; only raised further issues. Eventually, I rebuilt Graabr as a Delphi dll with three exposed interfaces. That is not enough for Firefox though. You cannot simply call a Delphi dll from Firefox, not without all the Firefox libs. So, what next? A download of the now free Visual C++ 2008 Express Edition (<a href="http://http://www.microsoft.com/Express/VC/">http://www.microsoft.com/Express/VC/</a>). Incidentally, and one for another post, why is Delphi 2010 so expensive? After download and install, a lot of googling to get a XLRunner sample working in C++. Then, build a C++ dll wrapper, compatible with Firefox around the Delphi DLL. And voila, problem solved. Here is a link to the finished Graabr add-on:</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/52178/">https://addons.mozilla.org/en-US/firefox/addon/52178/</a></p>
<p>So, how does everything hang together? Well, after creating the extension framework, or environment, with all the required folders, files, etc (see here: <a href="https://developer.mozilla.org/en/Building_an_Extension">https://developer.mozilla.org/en/Building_an_Extension</a>), I created a small javascript app. which interfaces between Firefox and the C++ DLL. You can examine the source of this file by looking in the FF extension folder.  The javascript calls the C++ DLL which in turn calls the good old Delphi DLL where all the screen grabbing, uploading, etc work is done.  After creating the environment, files, structure, etc, you zip it all up into a .xpi file (zippy as they call it) and upload it to FireFox addons.</p>
<p>Oh, it&#8217;s oh so simple <img src='http://wizard-soft.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wizard-soft.com/blog/2009/11/30/firefox-addons-xul-xpcom-delphi-and-a-few-headaches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

