[pywin32-bugs] Build 214 with python 2.7 gen_py selecting wrong type, can't override
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Oliver N. <ol...@oo...> - 2011-01-25 16:31:47
|
I'm using mappoint 2010 (16.0) with python. I'm having a problem due to a MP bug, but I can't find a way around this problem in Python. MP has a property on an object called StartTime. It is documented in MP help as a Date type. Python thinks its a Time. In another early binding language I use, it is detected as a VT_DATE, but in fact it is none of these. Its a BSTR. I edited the generate python package, and changed this in the get property map: "StartTime": (100670213, 2, (7, 0), (), "StartTime", None), to: "StartTime": (100670213, 2, (8, 0), (), "StartTime", None), and then in the vtable: (( u'Directions' , u'ppVal' , ), 100670210, (100670210, (), [ (16393, 10, None, "IID('{9EE7CB66-2A15-4CFF-9DEC-A9D162DCD38D}')") , ], 1 , 2 , 4 , 0 , 52 , (3, 0, None, None) , 0 , )), I changed 16393 to 16392 which is the value all the BSTR properties were using (and 16393 is the value all the date properties were using) Even after doing this, python still sees the property as a Time type which is a problem because when you try to access the property, it crashes python. It seems that the code being generated for this early bound control is being dynamically overridden at some point? Is there some other place I'm unaware of that this data is set? This same project doesn't have this problem in python 2.5 and in fact it works as a time variable. OLIVER |