[please keep on-list for the sake of others. I've not trimmed things accordingly...]
> -----Original Message----- > From: Simon Carter [mailto:bbbscar...@gmail.com] > Sent: Wednesday, 22 April 2009 7:15 PM > To: mhamm...@skippinet.com.au > Subject: Re: [python-win32] COM and retrieving records/structures > > Hi Mark, many thanks for the reply. > > > That seems a little strange - for a property-getter I wouldn't expect > any args - just a result type. If it returned a struct, I'd expect the > COM object to allocate and return it in a new variant. > > Well, the getter method looks like this: > HRESULT get_RunningProcessInfo( PXBOX_PROCESS_INFO ProcessInfo ); > > which looks sane to my eyes. > > And the full traceback is: > File "<stdin>", line 1, in <module> > File "c:\Python26\lib\site-packages\win32com\client\__init__.py", > line 502, in __getattr__ > if d is not None: return getattr(d, attr) > File "c:\Python26\lib\site-packages\win32com\client\__init__.py", > line 463, in __getattr__ > return self._ApplyTypes_(*args) > File "c:\Python26\lib\site-packages\win32com\client\__init__.py", > line 456, in _ApplyTypes_ > self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, > *args), > pywintypes.com_error: (-2147024809, 'The parameter is incorrect.', > None, None) > > > What does the method say exactly? It will list the 'variant type' of > objects it knows. > The C function definition is above. In the generated py file there's a > reference to RunningProcessInfo in the _prop_map_get_ table in the > class definition I'm using: > > class IXboxConsole(DispatchBaseClass): > """Xbox Console""" > CLSID = IID('{75DD80A9-5A33-42D4-8A39-AB07C9B17CC3}') > coclass_clsid = IID('{3ED2B073-99A1-42DB-80CC-295E9FFBA18F}') > <snip> > > _prop_map_get_ = { > <snip> > "RunningProcessInfo": (102, 2, (36, 0), (), > "RunningProcessInfo", None), > <snip> > } > > and also in the vtables section: > (( u'RunningProcessInfo' , u'ProcessInfo' , ), 102, (102, (), [ > (36, > 10, None, None) , ], 1 , 2 , 4 , 0 , 96 , (3, 0, None, None) , 0 , )), > > IXboxConsole_vtables_ = [ > <snip> > (( u'RunningProcessInfo' , u'ProcessInfo' , ), 102, (102, (), [ > (36, > 10, None, None) , ], 1 , 2 , 4 , 0 , 96 , (3, 0, None, None) , 0 , )), > <snip> > ] > > I can't find any other reference to that 'ProcessInfo' string > anywhere, so I'm not sure what that's doing. > > > > > I'd also expect all referenced records to be written to the generated > .py file - eg, the VB tests in the test suite write: > > > > RecordMap = { > > u'SubSubStruct': '{CB2C0086-0FCC-4350-93A3-E5C85CF53FE6}', > > u'VBStruct': '{69A22CFE-4269-4131-8C50-E54CA915E310}', > > u'SubStruct': '{CB58821D-CAEC-43C0-B801-7C137B32C598}', > > } > > Yeah, this may be the root of the problem. There is a RecordMap in the > generated .py file, but it contains only one record. The library has > 10 or 15 such record types in it, so it's curious that only one is > appearing: > > RecordMap = { > u'XBOX_AUTOMATION_GAMEPAD': '{00000000-0000-0000-0000- > 000000000000}', > } I suspect the fact these objects are using a NULL IID is the cause of this problem. Does the COM browser also reflect this IID? Are you in contact with the author of the object such that you can ask why that is the case? Cheers, Mark > > The curious thing is that all these structures *do* appear in the > pythonwin COM browser. Also I'm not sure if it helps narrows things > down, but I've used this library via C# and it seemed to work okay, > but I don't know if .Net handles COM marshalling differently... > > > Not much help, but it might edge us towards the answer... > > Well, any help is very much appreciated! Thanks for your time - if > there's anything else I can send to help track this down, let me know. > > Thanks! > > Simon _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32