[python-win32] Module not found weirdness

Derick Van Niekerk derickvn at gmail.com
Tue Sep 19 10:16:57 CEST 2006


When I execute the code here
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355593 I get the
following traceback:

Traceback (most recent call last):
 File "C:\Documents and Settings\Derick\Desktop\test.py", line 73, in ?
frame = TestFrame ()
 File "C:\Documents and Settings\Derick\Desktop\test.py", line 23, in
__init__
self.nextWnd = win32clipboard.SetClipboardViewer (self.hwnd)
pywintypes.error: (126, 'SetClipboardViewer', 'The specified module could
not be found.')
Script terminated.

I have run dependency walker and found that all the dlls load fine. The
other win32clipboard functions work fine as well, like getting and setting
the clipboard contents. I have found that SetClipboardViewer ( self.hwnd)
should be in user32.dll but I have the same version installed as on my PC at
work where the program runs without a problem.

The strange thing is that all the other functions I tried work fine, which
would indicate that I might be using an old version of some dll - the
function might not exist in the module dll I'm using. user32 doesn't seem at
fault though since it is the same on both PC's...

What could be the problem? Google couldn't teach me anything on this problem

This code doesn't work:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355593

But this does - even though it uses the same module:

import win32clipboard as w
import win32con

def getText():
    w.OpenClipboard()
    d=w.GetClipboardData(win32con.CF_TEXT)
    w.CloseClipboard()
    return d

def setText(aType,aString):
    w.OpenClipboard()
    w.EmptyClipboard()
    w.SetClipboardData(aType,aString)
    w.CloseClipboard()


-d-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060919/cdb7448f/attachment.html 


More information about the Python-win32 mailing list