[pywin32-bugs] [ pywin32-Bugs-978096 ] Problem with nested dispatches in build 201
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2006-02-20 09:33:35
|
Bugs item #978096, was opened at 2004-06-23 09:54 Message generated for change (Comment added) made by gtegos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=978096&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: George Tegos (gtegos) Assigned to: Nobody/Anonymous (nobody) Summary: Problem with nested dispatches in build 201 Initial Comment: We have an application which exposes an automation object Application. One member of Application is Zip which is another automation object which has a property Recursive of type BOOL. In a Python script we have: Application.Zip.Recursive = 1 With build 201 we get a COM error saying that we have a wrong number of parameters. The same was working fine with build 200 ---------------------------------------------------------------------- >Comment By: George Tegos (gtegos) Date: 2006-02-20 09:33 Message: Logged In: YES user_id=464497 After a long while, I am reopening this issue, as I am trying to upgrade from pythonwin 200 to pythonwin207 for Python 2.3. The problem still exists. I attach the file Problem.odl, in which I define two interfaces, IApplicationAuto and IZipAuto. The interface IApplicationAuto has a member Zip, which returns an object implementing the IZipAuto interface. When setting, from a script, Application.Zip.NoDirectoryEntries = 0 I am getting the following error: Source line: Application.Zip.NoDirectoryEntries = 0 Traceback... c:\python\lib\site-packages\win32com\client\dynamic.py line 528 in __setattr__ self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value) COM Error: Invalid number of parameters (0x8002000e...) The Application automation class is implemented in MFC using BEGIN_DISPATCH_MAP(CApplicationAuto, CHHCmdTarget) //{{AFX_DISPATCH_MAP(CApplicationAuto) DISP_PROPERTY_EX(CApplicationAuto, "SerialNumber", GetSerialNumber, SetNotSupported, VT_BSTR) DISP_PROPERTY_EX(CApplicationAuto, "Zip", GetZip, SetZip, VT_DISPATCH) ... END_DISPATCH_MAP() ---------------------------------------------------------------------- Comment By: George Tegos (gtegos) Date: 2004-10-12 09:31 Message: Logged In: YES user_id=464497 I attach a strip down version of the odl file describing Application and Zip objects. I debugged the code using versions 203 and 200. The problem seems to be in CDispatch.__setattr__ if self.__LazyMap__(attr): # Check the "general" property map. if self._olerepr_.propMap.has_key(attr): entry = self._olerepr_.propMap[attr] invoke_type = _GetDescInvokeType ... self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value) return invoke_type has the value of 3 in version 203 instead of 4 (pythoncom.INVOKE_PROPERTYPUT) in version 200, which works. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2004-10-09 01:48 Message: Logged In: YES user_id=14198 Could you please provide a sample or some way for me to repro this? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=978096&group_id=78018 |