[pywin32-bugs] (no subject)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Karakus, E. <Ece...@ap...> - 2004-09-16 06:33:25
|
--Hello Programmers,=20 =09 A few days ago I wrote this Bug-Descreption, But I got only one Answer, which didn't help. So I try it again whith an other Question, which would also solve the problem above. Is it Possible to force PyWin to use Dynamic Dispatching and not the generated MakePy-Wrapper ? =20 Origin Promlem:=20 I need your Support for this Problem: Makepy doesn't work correct=20 =09 Please Look at this Coding:=20 =09 This Works !!!!!!=20 ______________________________________=20 import win32com.client=20 xneu=3D win32com.client.GetObject("SAPGUI")=20 script =3D xneu.GetScriptingEngine=20 Connection =3D script.Children(0)=20 Session =3D Connection.Children(0) <-------=20 =09 ______________________________________=20 =09 After Using Makepy for the OCX=20 =09 _______________=20 =09 if d is not None: return getattr(d, attr)=20 File "C:\Prog\Python\ActPython23\Lib\site-packages\win32com\client\__init__.py= ", line 454, in __getattr__=20 raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr)=20 AttributeError: '<win32com.gen_py.SAP Scripting Control.ISapComponentTarget instance at 0x19183176>' object has no = attribute 'Children' Before mapeky attributes are case insensitive. After makepy they are case sensitive. So you might try Connection.children(0) [Karakus, Ecevit]=20 [Karakus, Ecevit] I have tried this, but this is not The Point.=20 I Suppose that the Wrapper which was generated by makepy is the ErrorSource.=20 But dont know How to narrow this down.=20 I debugged a while but ended in the nirwana=20 Do You Know any Contact Person ,EmailAdress, etc whom I could ask ?=20 Before mapeky attributes are case insensitive. After makepy they are case sensitive. So you might try Connection.children(0) =09 _________________________________=20 =09 The Error is raised in the line=20 Session =3D Connection.Children(0)=20 worked correctly before using makepy=20 =09 I can help myself by deleting the makepy-generated files but this is not a solution in this case.=20 =09 The Problem is that I need Makepy, because I want to use a Event Handler for that Com-Object=20 and proceed with=20 Session_events =3D win32com.client.DispatchWithEvents(Session, SessionEvents)=20 But this line generates automatically Makepy-Support=20 When I want to use the next time the Coding abov I get the Error.=20 =09 APRIMUS GmbH =20 Weidestrasse 120a 22083 Hamburg Germany =20 Tel. : +49 (40) 2709 53-118 Fax : +49 (40) 2709 53-218 Mobil : +49 (170) 412 64 69=20 E-Mail : ece...@ap... URL : www.aprimus.de <http://www.aprimus.de/> Neue Adresse seit 01.07.2004 New address since 01. July 2004 |