[ctypes-commit] ctypes/comtypes/automation __init__.py,1.2,1.3
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-02-24 16:17:53
|
Update of /cvsroot/ctypes/ctypes/comtypes/automation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1367 Modified Files: __init__.py Log Message: Fix GetTypeInfo(), and add some constants. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/automation/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 16 Feb 2005 20:46:35 -0000 1.2 --- __init__.py 24 Feb 2005 16:17:23 -0000 1.3 *************** *** 30,33 **** --- 30,38 ---- VARTYPE = c_ushort + DISPATCH_METHOD = 1 + DISPATCH_PROPERTYGET = 2 + DISPATCH_PROPERTYPUT = 4 + DISPATCH_PROPERTYPUTREF = 8 + ################################ # helper constants *************** *** 306,310 **** def GetTypeInfo(self, index, lcid=0): ! p = POINTER(IUnknown)() self.__com_GetTypeInfo(index, lcid, byref(p)) return p --- 311,316 ---- def GetTypeInfo(self, index, lcid=0): ! from typeinfo import ITypeInfo ! p = POINTER(ITypeInfo)() self.__com_GetTypeInfo(index, lcid, byref(p)) return p *************** *** 376,380 **** ################################################################ ! if __name__ == "__main__": oledll.ole32.CoInitialize(None) p = POINTER(IDispatch)() --- 382,386 ---- ################################################################ ! if 0 and __name__ == "__main__": oledll.ole32.CoInitialize(None) p = POINTER(IDispatch)() *************** *** 388,392 **** byref(p)) for i in range(p.GetTypeInfoCount()): ! result = p.GetTypeInfo(i) id_quit = p.GetIDsOfNames("Quit")[0] --- 394,398 ---- byref(p)) for i in range(p.GetTypeInfoCount()): ! print p.GetTypeInfo(i) id_quit = p.GetIDsOfNames("Quit")[0] *************** *** 396,404 **** try: ! p.Invoke(id_visible, True, wFlags = 4) ! p.Invoke(id_navigate, "http://www.python.org/", 1) import time ! time.sleep(3) ! p.Invoke(id_quit, wFlags = 1) ## p.Invoke(id_quit, True, wFlags = 1) finally: --- 402,410 ---- try: ! ## p.Invoke(id_visible, True, wFlags = 4) ! ## p.Invoke(id_navigate, "http://www.python.org/", 1) import time ! ## time.sleep(3) ! print p.Invoke(id_quit) ## p.Invoke(id_quit, True, wFlags = 1) finally: |