<?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>Irfan Raza</title>
	<atom:link href="http://irfanraza.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://irfanraza.wordpress.com</link>
	<description>The howling of wolverine</description>
	<lastBuildDate>Mon, 20 Apr 2009 07:07:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='irfanraza.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Irfan Raza</title>
		<link>http://irfanraza.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://irfanraza.wordpress.com/osd.xml" title="Irfan Raza" />
	<atom:link rel='hub' href='http://irfanraza.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Call Windows Scripting Components (WSC) from C/C++</title>
		<link>http://irfanraza.wordpress.com/2009/04/16/call-windows-scripting-components-wsc-from-cc/</link>
		<comments>http://irfanraza.wordpress.com/2009/04/16/call-windows-scripting-components-wsc-from-cc/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 10:04:30 +0000</pubDate>
		<dc:creator>Irfan Raza</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[sripting components]]></category>
		<category><![CDATA[WSC file]]></category>

		<guid isPermaLink="false">http://irfanraza.wordpress.com/?p=39</guid>
		<description><![CDATA[How to call Windows Scripting Components from C/C++   Windows Scripting Components Windows scripting components is a very powerful technology to create COM components using VB script and java script. More&#8230;   The main benefit of this kind of Com object is that they are easy to create and requires no compilation. So if you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanraza.wordpress.com&amp;blog=638486&amp;post=39&amp;subd=irfanraza&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">How to call Windows Scripting Components from C/C++</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:9pt;font-family:Verdana;">Windows Scripting Components</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Windows scripting components is a very powerful technology to create COM components using VB script and java script. <a href="http://msdn.microsoft.com/en-us/library/asxw6z3c(VS.85).aspx">More&#8230;</a></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">The main benefit of this kind of Com object is that they are easy to create and requires no compilation. So if you require creating a multi platform application with some shared functionality then use the scripting components to create those common functionality components.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">As these components are COM object hence are easily useable within all the languages over windows platform. Here I will discuss only C language.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:9pt;font-family:Verdana;">Create a Simple Scripting Component</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">First of all you should be able to create a simple scripting component. You can easily do that in notepad but i would recommend that you use <a href="http://www.microsoft.com/downloads/details.aspx?familyid=408024ed-faad-4835-8e68-773ccc951a6b&amp;displaylang=en">Microsoft Windows Scripting Component Wizard</a> to create a Scripting Component to avoid mistakes. This wizard will let you create a simple scripting file of WSC extension with skeleton of methods and variable that you want to expose. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">After downloading/installing the scripting wizard run it from the Programs Menu.</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Give the Name of the component; I am giving it &#8220;Irfantest&#8221;, press Next to move to next page…</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Select language as VB.</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Uncheck the Special Implement support and select Error Checking as runtime option. Press Next…</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">If you want to add some properties of the component add it, in this example I will not be using any property. Press Next…</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Now on the Methods Screen you can add those functions that you want to be exposed by this object, add a method by the Name of &#8220;Irfantestmethod&#8221;, add a parameter by the name of &#8220;teststr&#8221; and press Next…</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">The next screen is the Add Event screen, we are not going to handle any event in this component hence skip to next screen…</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Finish the wizard and you will be able to see a WSC file in the specified location.</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 .25in;"><span style="font-size:9pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Edit the file using any editor and edit the methods that you specified during its creation (In this example &#8220;Irfantestmethod&#8221;), Add a line in the method to show a Message Box which shows the parameter &#8220;teststr&#8221; to screen.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Your WSC file should look like following with off course with a different classid:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;?xml version=&#8221;1.0&#8243;?&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;component&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;?component error=&#8221;true&#8221; debug=&#8221;false&#8221;?&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;registration</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>description=&#8221;Irfantest&#8221;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>progid=&#8221;Irfantest.WSC&#8221;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>version=&#8221;1.00&#8243;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>classid=&#8221;{3d97f297-4b97-4f6b-bfb4-95890bc2b2a2}&#8221;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&gt; </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;/registration&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;public&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>&lt;method name=&#8221;Irfantestmethod&#8221;&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                        </span>&lt;PARAMETER name=&#8221;teststr&#8221;/&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>&lt;/method&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;/public&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;script language=&#8221;VBScript&#8221;&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;![CDATA[</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">function Irfantestmethod(teststr)</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>MsgBox "Hello Irfan"</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>Irfantestmethod = "returned"</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">end function</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">]]&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;/script&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&lt;/component&gt;</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Register this file using regsvr32 command from run.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:9pt;font-family:Verdana;">Call the WSC function from C</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Your test component is ready. Now let’s have a look at the C code that is going to call the method &#8220;Irfantestmethod&#8221;.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Create a new project in visual studio.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Keep the project as a console application.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Add a Function as:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">int CallWscComponent(char *cFileName, char*cFunctionName)</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">To call a WSC component function with some arguments is a bit different then calling a C++ or VB com object, you must define an array of VARIANT type which will hold the passing arguments along with their data types. We are using only one argument in the WSC object hence we will create an array of size one:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">VARIANT arg[1];</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Define the Type of the argument i.e. string:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">arg[0].vt = VT_BYREF|VT_BSTR; </span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">You can find the definition of other types in ks.h file under &#8220;c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include&#8221; directory.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">I needed to pass a string &#8220;Hello World&#8221; to the WSC object method &#8220;Irfantestmethod&#8221;.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">CString tempValue = &#8220;Hello World&#8221;;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">BSTR bb = tempValue.AllocSysString();</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">arg[0].pbstrVal = &amp;bb;</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Use the CoGetObject to get the pointer to the object.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">hr = CoGetObject(lpWscFileName, NULL, IID_IDispatch, (void**)&amp;objWsc);</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Get the mapping of the function Ids, in our case we only have one function that is required to be called hence only the name of that specific member function is passed, incase if more then 1 id is required of WSC member functions, and pass an array of function name. Subsequently the return IDs will be in an array.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">hr = objWsc-&gt;GetIDsOfNames(IID_NULL, &amp;sMemFuncName, 1, LOCALE_SYSTEM_DEFAULT, &amp;dispid);</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Using the Id returned by the GetIDsoFName function call the “Invoke” method to execute the WSC function</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;font-family:Verdana;">hr = objWsc-&gt;Invoke( dispid,IID_NULL,LOCALE_USER_DEFAULT, DISPATCH_METHOD, &amp;paramArgs, &amp;vResult, NULL, NULL);</span></em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">The complete C code of the WSC call is as follow:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">LPCWSTR MultiCharToUniChar(char* cStr)</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>int iLen = strlen(cStr) + 1;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>wchar_t *ucString = new wchar_t[iLen];</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>if (::MultiByteToWideChar(CP_ACP, 0, cStr, iLen, ucString , iLen) == 0)</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                                    </span>return NULL;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span></span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>return (LPCWSTR)ucString;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">}</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">int CallWscComponent(char *cFileName, char*cFunctionName)</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>HRESULT hr = -1;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>IDispatch* objWsc;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>DISPID dispid;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>VARIANT vResult;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>VariantInit(&amp;vResult);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>CString strFuncName = cFunctionName;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>OLECHAR * sMemFuncName = strFuncName.AllocSysString();</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>DISPPARAMS paramArgs;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>LPCWSTR lpWscFileName = MultiCharToUniChar(cFileName);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>VARIANT vArg[1];</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>vArg[0].vt = VT_BYREF|VT_BSTR; </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>CString tempValue = &#8220;Hello World&#8221;;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>BSTR bstring = tempValue.AllocSysString();</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>vArg[0].pbstrVal = &amp;bstring;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>paramArgs.rgvarg = vArg;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>paramArgs.cArgs = 1;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>paramArgs.cNamedArgs = 0;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>    </span></span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>if(lpWscFileName != NULL)</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                        </span>hr = CoGetObject(lpWscFileName, NULL, IID_IDispatch, (void**)&amp;objWsc);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                        </span>delete[] lpWscFileName;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>}</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>if (FAILED(hr))</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                        </span>return(hr);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>}</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>hr = objWsc-&gt;GetIDsOfNames(IID_NULL, &amp;sMemFuncName, 1, LOCALE_SYSTEM_DEFAULT, &amp;dispid);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>if (FAILED(hr))</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                        </span>return(hr);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>}</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>hr = objWsc-&gt;Invoke( dispid,IID_NULL,LOCALE_USER_DEFAULT, DISPATCH_METHOD, </span></em><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">&amp;paramArgs, &amp;vResult, NULL, NULL);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>if (FAILED(hr))</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>                        </span>return(hr);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>}</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">}</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">{</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>int nRetCode = 0;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"> </span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>CoInitialize (NULL);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>CallWscComponent(&#8220;script:G:\\TEST Developments\\WSCCall\\Irfantest.WSC&#8221;,&#8221;Irfantestmethod&#8221;);</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>CoUninitialize();</span></em></p>
<p class="MsoNormal" style="margin:0;"><em></em></p>
<p class="MsoNormal" style="margin:0;"><em></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;"><span>            </span>return nRetCode;</span></em></p>
<p class="MsoNormal" style="margin:0;"><em><span style="font-size:9pt;color:#339966;font-family:Verdana;">}</span></em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanraza.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanraza.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanraza.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanraza.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanraza.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanraza.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanraza.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanraza.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanraza.wordpress.com&amp;blog=638486&amp;post=39&amp;subd=irfanraza&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanraza.wordpress.com/2009/04/16/call-windows-scripting-components-wsc-from-cc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/23a2119984f1de20e52bc3230c05cb96?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">irfanraza</media:title>
		</media:content>
	</item>
		<item>
		<title>A Simple HTTPS Client</title>
		<link>http://irfanraza.wordpress.com/2009/03/04/simple-https-client/</link>
		<comments>http://irfanraza.wordpress.com/2009/03/04/simple-https-client/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 09:26:11 +0000</pubDate>
		<dc:creator>Irfan Raza</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[msxml]]></category>

		<guid isPermaLink="false">http://irfanraza.wordpress.com/?p=25</guid>
		<description><![CDATA[How to create a simple HTTPS client<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanraza.wordpress.com&amp;blog=638486&amp;post=25&amp;subd=irfanraza&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to create a simple HTTPS Client?</p>
<p>Some time ago this question was roaming in my mind as I was looking for a way to communicate to an HTTPS Server from a desktop application, I was able to find some on the internet but i needed a library which I can use to send request and recieve data to an HTTPS web server. Many libraries are available on the internet as well but I was unable to find a free one which is easy to use as well <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  As a C++ coder we are always in search of one that is easy to use <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Then I came across this article which led me to create a very simple HTTPS client application which was able to send and recieve data to a Web server using MSXML4.0. Its setup can be easily downloaded from Microsoft site, its a com dll hence can be easily called in C++ or VB, I tried it in VB and here is a simple code:</p>
<p>Open up VB console and create a new Project of &#8220;Standard Exe&#8221;.</p>
<p>Add a Reference of &#8220;Microsoft XML, v4.0&#8243; to the project from the Project Menu. (The dll will be Msxml4.dll)</p>
<p>Define a variable of the request as:<br />
<em>   Dim httpsreq As New MSXML2.XMLHTTP40<br />
   Dim temp As String</em></p>
<p>Rest of the code can be written on the event of a Button or In the Form_Load method.</p>
<p>open up the URL first by POST method:<br />
<em>   httpsreq.Open &#8220;POST&#8221;, &#8220;</em><a href="https://localhost/TesthttpsServer/test.aspx"><em>https://localhost/TesthttpsServer/test.aspx</em></a><em>&#8220;, False, Empty, Empty</em></p>
<p>Set the data that you want to send to the HTTPS server:<br />
<em>  temp = &#8220;This is a test request to test server&#8221;</em></p>
<p>Now set the request headers, i am not going to go in details of the header parameters:</p>
<p> <em>httpsreq.setRequestHeader &#8220;User-Agent&#8221;, &#8220;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)&#8221;<br />
 httpsreq.setRequestHeader &#8220;Accept&#8221;, &#8220;image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, application/vnd.ms-excel, */*&#8221;<br />
 httpsreq.setRequestHeader &#8220;Accept-Language&#8221;, &#8220;en-us\r\n&#8221;<br />
 httpsreq.setRequestHeader &#8220;Content-Length&#8221;, Len(temp)<br />
 httpsreq.setRequestHeader &#8220;Content-Type&#8221;, &#8220;application/x-www-form-urlencoded&#8221;<br />
 httpsreq.setRequestHeader &#8220;Cache-Control&#8221;, &#8220;no-cache&#8221;</em></p>
<p>Now you are ready to post a requesst to the HTTPS server, this call can take long depending upon the response time of your server:<br />
 <em>httpsreq.send temp</em></p>
<p>After the request is executed you will be able to recieve the status of request either Success or failed:<br />
 <em>MsgBox &#8220;Reponse Status = &#8221; &amp; httpsreq.Status</em></p>
<p>If your Test Https server is to return some data to you, you can recieve it as:<br />
 <em>MsgBox &#8220;Reponse body = &#8221; &amp; httpsreq.ResponseBody &amp; &#8220;. Response text = &#8221; &amp; httpsreq.responseText</em></p>
<p>Thats it, this is all that is required to set up a small HTTPS client <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The same code can be used for HTTP requests, just use HTTP instead of HTTPS in the Open method.<br />
<em> httpsreq.Open &#8220;POST&#8221;, &#8220;</em><a href="http://localhost/TesthttpsServer/test.aspx"><em>http://localhost/TesthttpsServer/test.aspx</em></a><em>&#8220;, False, Empty, Empty</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanraza.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanraza.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanraza.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanraza.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanraza.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanraza.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanraza.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanraza.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanraza.wordpress.com&amp;blog=638486&amp;post=25&amp;subd=irfanraza&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanraza.wordpress.com/2009/03/04/simple-https-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/23a2119984f1de20e52bc3230c05cb96?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">irfanraza</media:title>
		</media:content>
	</item>
		<item>
		<title>XFS &amp; its Applications</title>
		<link>http://irfanraza.wordpress.com/2008/10/23/an-introduction-to-xfs/</link>
		<comments>http://irfanraza.wordpress.com/2008/10/23/an-introduction-to-xfs/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 07:35:53 +0000</pubDate>
		<dc:creator>Irfan Raza</dc:creator>
				<category><![CDATA[Blogroll]]></category>

		<guid isPermaLink="false">http://irfanraza.wordpress.com/?p=15</guid>
		<description><![CDATA[Background With the extensive growth in the financial industry especially in United States and Europe in the early 90’s, an immediate need was felt for an industry wide platform to standardize the development of the financial systems. Microsoft at that time was the first one to realize this necessity and founded “Banking Solutions Vendor Council” [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanraza.wordpress.com&amp;blog=638486&amp;post=15&amp;subd=irfanraza&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:Verdana;">Background</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">With the extensive growth in the financial industry especially in United States and Europe in the early 90’s, an immediate need was felt for an industry wide platform to standardize the development of the financial systems. Microsoft at that time was the first one to realize this necessity and founded “Banking Solutions Vendor Council” in 1991 which comprises of leading vendors of Information technology of the financial Industry. Based on the windows platform using “Windows Open service Architecture” the very first version of the Financial Systems development Framework was introduced as “Extension for Financial Services” or WOSA/XFS. The very first version of XFS was released in 1995<span>   </span>followed by XFS 2.0 in 1997. We are using XFS 3.10 at the moment in 2008.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">XFS was a revolution and a major success in the financial industry which leads to its adoption by <a href="http://www.cen.eu/cenorm/homepage.htm" target="_blank">CEN (European committee for standardization)</a> as an international standard in 1998 and was named as CEN/XFS.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:Verdana;">Definitions</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"><a href="http://en.wikipedia.org/wiki/CEN/XFS" target="_blank">Wikipedia defines CEN/XFS</a> as “<strong>CEN/XFS</strong> or <strong>XFS</strong> provides client-server architecture for financial applications on the Microsoft Windows platform, especially peripheral devices such as EFTPOS terminals and ATMs which are unique to the financial industry”. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">I as a developer of the XFS will define it in simpler manner as “An SP (Service provider) independent windows based set of APIs for communication with peripheral devices like <a href="http://www.wisegeek.com/what-is-eftpos.htm" target="_blank">EFTPOS</a> and ATMs”.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">You can make your system XFS compliant by following the following three conditions:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The Service providers should make their device drivers compliant with the “XFS Manager” as distributed by Microsoft.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Must be Win32 based.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Should be compatible with the published XFS API definition.</span></li>
</ol>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:Verdana;">Distinct Features</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">The key element of the XFS is the definition of set of APIs and a corresponding set of SPIs providing services to Windows based applications. XFS provides the set of APIs to the application developers which they can use without getting worried about the service providers; for example the Printers of the ATMs are provided by multiple vendors in the market, by implementing an XFS based application the developer should not worry about the make and model of the printer if the printer SP is compatible with the XFS Manager and XFS API, the same application will work without changing a single line of code. As far as I know all the peripheral device providers of ATMs and EFTPOS now are compatible with the XFS Manager and hence supports the XFS APIs. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">One of the most powerful things provided by CEN/XFS is Form based printing from the peripheral devices like journal, receipt and document printers. Form is a simple specially formatted text file which is called within the XFS based application using the XFS APIs. The main advantage of using Form based printing is the ease of editing the printing data without recompiling your code but the developer should have to be very careful while editing a Form because a single wrong byte will crash the whole system and cause the machine to restart. There are many tools in the market to <a href="http://www.topshareware.com/(WOSA)-XFS-Form-Editor-download-3436.htm" target="_blank">generate an XFS Form</a>.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:Verdana;">Applications</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">All the Financial standards like “Aptra Advance NDC” by NCR and “DTC” by Diebold are XFS compatible hence are vendor independent. XFS is the reason which made AANDC work on Diebold ATM machines without using any Emulator. NCR realizes the importance of XFS quite late in 2004 where they started developing their first XFS based vendor independent software AANDC 3.0. Before the release of 3.0 XFS was introduced in the AANDC 2.6 but at that time some devices were supporting ADI (Active Device interface) which was the reason of not completely moving to XFS.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">We as the providers of the ATM extension application like Biometric authentication over ATMs, Non <a href="http://en.wikipedia.org/wiki/EMV">EMV</a> Chip card transactions on ATMs, Cash and Cheque deposit enhancements on ATMs and integration of CRM with ATMs have a lot of applications of XFS. For me our perfect implementation of XFS was a system developed for Oman Arab Bank in 2007 to support DUET standard Chip cards over the ATM. I used XFS APIs to communicate with the Card ICC where we were reading and writing the card holder data on the chip and the XFS forms for printing Receipts and journal. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">The implementation went extremely successful because no code was changed for different devices of the ATMs and I was really very relaxed except in the very end of the implementation just before the GO LIVE activity the Bank requested the journal printing module which was not even written, that was the point where I really felt the flexibility of XFS API because I only changed the logical name of the receipt printing module to journal printer and the journal printing started working.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">For the bank it was an amazing thing, a completely new module of journal printing developed and tested properly within a day just before the GO LIVE activity (not to mention how thankful they were), but for me it was only a function call with journal printer logical name provided instead of receipt printer</span><span style="font-size:10pt;font-family:Wingdings;"><span>J</span></span><span style="font-size:10pt;font-family:Verdana;">.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanraza.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanraza.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanraza.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanraza.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanraza.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanraza.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanraza.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanraza.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanraza.wordpress.com&amp;blog=638486&amp;post=15&amp;subd=irfanraza&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanraza.wordpress.com/2008/10/23/an-introduction-to-xfs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/23a2119984f1de20e52bc3230c05cb96?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">irfanraza</media:title>
		</media:content>
	</item>
	</channel>
</rss>
