title: Python | accessing dll using ctypes
body: <p>I'm trying to access some functions in a dll (<strong>nss3.dll</strong>) that ships with Firefox web browser. To handle this task I have used ctypes in Python. The problem is that it fails at the initial point which is when loading the dll in to the memory.</p>
  
  <p>This is the code snippet that I have to do so.</p>
  
  <pre><code>&gt;&gt;&gt; from ctypes import *
  &gt;&gt;&gt; windll.LoadLibrary("E:\\nss3.dll")
  </code></pre>
  
  <p>The exception I'm getting is</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#2&gt;", line 1, in &lt;module&gt;
      windll.LoadLibrary("E:\\nss3.dll")
    File "C:\Python26\lib\ctypes\__init__.py", line 431, in LoadLibrary
      return self._dlltype(name)
    File "C:\Python26\lib\ctypes\__init__.py", line 353, in __init__
      self._handle = _dlopen(self._name, mode)
  WindowsError: [Error 126] The specified module could not be found
  </code></pre>
  
  <p>I also tried loading it from the Firefox installation path assuming that there maybe dependencies.</p>
  
  <pre><code>&gt;&gt;&gt; windll.LoadLibrary("F:\\Softwares\\Mozilla Firefox\\nss3.dll")
  </code></pre>
  
  <p>But I'm getting the same exception as mentioned above.</p>
  
  <p>Thanks.</p>