title: How to call dll function from javascript
body: <p>I am trying to integrate the thumb impression machine with my web site. Firstly Thumb Impression Machine capture the fingerprint as an input and then save input in the form of image. Now I want below mentioned functionalities in my web applications:</p>
  
  <ul>
  <li>Thumb Impression machine should be open by web page after click on button.</li>
  <li>Then fingerprint should be captured by machine.</li>
  <li>The captured fingerprint image should be display on web page.</li>
  <li>The Thumb Impression machine should be closed by web page.</li>
  </ul>
  
  <p><b>*I am assuming that driver is already installed in client machine.</b><br><br></p>
  
  <p>After google these thing I found that these thing can be achieve using javascript because javascript is run on client site. </p>
  
  <p>I also found the below javascript code for the same.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script language='javascript'&gt;
  function capture()
  {
  var err
  // Check ID is not NULL
  if ( document.MainForm.UserID.value == '' )
  {
  alert('Please enter user id !');
  return(false);
  }
  try // Exception handling
  {
  // Open device. [AUTO_DETECT]
  // You must open device before capture.
  var DEVICE_FDP02 = 1;
  var DEVICE_FDU01 = 2;
  var DEVICE_AUTO_DETECT = 255;
  var objDevice = document.objNBioBSP.Device;
  var objExtraction = document.objNBioBSP.Extraction;
  
  objDevice.Open(DEVICE_AUTO_DETECT);
  err = objDevice.ErrorCode; // Get error code
  if ( err != 0 ) // Device open failed
  {
  alert('Device open failed !');
  return(false);
  }
  
  // Enroll user's fingerprint.
  objExtraction.Capture();
  err = objExtraction.ErrorCode; // Get error code
  if ( err != 0 ) // Enroll failed
  {
  alert('Capture failed ! Error Number : [' + err + ']');
  objDevice.Close(DEVICE_AUTO_DETECT);
  return(false);
  }
  else // Capture success
  {
  // Get text encoded FIR data from NBioBSP module.
  document.MainForm.FIRTextData.value=objExtraction.TextEncodedFIR;
  alert('Capture success !');
  }
  
  // Close device. [AUTO_DETECT]
  objDevice.Close(DEVICE_AUTO_DETECT);
  objExtraction = 0;
  objDevice = 0;
  alert("return sucess without error");
  } // end try
  
  catch(e)
  {
  alert(e.message);
  return(false);
  }
  
  // Submit main form
  document.MainForm.submit();
  return(false);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  &lt;OBJECT classid="CLSID: F66B9251-67CA-4d78-90A3-28C2BFAE89BF" height=100 width=100 id="objNBioBSP" name="objNBioBSP"&gt; &lt;/OBJECT&gt;
  
  &lt;form action='verify.asp' name='MainForm' method='post' OnSubmit='return capture();'&gt; 
  &lt;input type=hidden name='FIRTextData'&gt;
  User ID : &lt;input type=text name=UserID size=20 value="001"&gt;
  &lt;br&gt;
  &lt;input type=submit value=' Click here to verification with your fingerprint '&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The classid of NBioBSPCOM is "F66B9251-67CA-4d78-90A3-28C2BFAE89BF" but I am getting below error alert message</p>
  
  <p><a href="http://i.stack.imgur.com/1xgXc.png" rel="nofollow">Error Message</a></p>
  
  <p>Please let me know what I am doing wrong.</p>