Re: alternatives to mswgui
Robin Becker <[email protected]> Thu, 14 Nov 2002 16:13:11 +0000
| Newsgroups | gmane.comp.python.anygui.devel |
|---|---|
| Message-ID | <[email protected]> |
In article <[email protected]>, Thomas Heller <[email protected]> writes ...... >then you can use GetModuleHandle to your hearts content, >and you do not have to check for errors. > >> >> What do others think of the competing msw approaches (if anything). > >Why not use both for a while amd decide later? > >> -- >> Robin Becker > >Thomas > I put this in the ctmswgui and it seems to work. from ctypes import CDLL, _DLLS, _DynFunction, CFunction, c_string, Structure, WinError, byref class WinDLLA(CDLL): def __getattr__(self, name): try: func = _DynFunction(name, self) except: func = _DynFunction(name+'A', self) setattr(self, name, func) return func windll = _DLLS(WinDLLA) If I was a bit cleverer I guess the 'A' could be part of the class setup and that would allow us to change the default fairly easily. Now that Python has unicode I suppose the possibility exists of having both 'A' and 'W' calls required. I'm too lazy to do anything right now. I'll check in the ctmswgui thing for others to poke at. -- Robin Becker ------------------------------------------------------- This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html