Mudcat wrote:
> So then I use the find_library function, and it finds it: > > >>> find_library('arapi51.dll') > 'C:\\WINNT\\system32\\arapi51.dll' > Notice it's escaped the '\' character. > At that point I try to use the LoadLibrary function, but it still can't > find it: > > >>> windll.LoadLibrary('C:\WINNT\system32\arapi51.dll') > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 395, in > LoadLibrary > return self._dlltype(name) > File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 312, in > __init__ > self._handle = _dlopen(self._name, mode) > WindowsError: [Errno 126] The specified module could not be found > > What am I doing wrong? [snip] You need to use either windll.LoadLibrary(r'c:\winnt\system32\arapi51.dll') or escape the \'s as the find_library function did. You're getting caught out by \a which is the alert/bell character. \w and \s aren't valid escape sequences so you get away with them. I'm guessing it's worked before because you've been lucky. Works fine!: >>> 'C:\winnt\system32\smtpctrs.dll' 'C:\\winnt\\system32\\smtpctrs.dll' Uh oh, escaped: >>> 'C:\winnt\system32\arapi51.dll' 'C:\\winnt\\system32\x07rapi51.dll' Jon. -- http://mail.python.org/mailman/listinfo/python-list