COM Question: VB cDate equivalent i Pythonwin
Hoon
yelled at yahoo.com
Sat Sep 29 20:13:14 EDT 2001
Hi,
I am working with ActiveX control from Bloomberg. This control has
cDate, which is an optional argument. I attempted to use both
mxDateTime and pywintypes.Time(time.time()), the first give me back
wrong type msg and later actually crashes pythonwin with usual
memory+unintelligible win error msg. I included Gen_py output as well
as VB code and my attempt with Pythonwin.
Thanks for just reading it,
X2 if anyone can really figure this out,
Hoon,
Gen_Py output:---------------------
def Subscribe(self, Security=defaultNamedNotOptArg,
cookie=defaultNamedNotOptArg, Fields=defaultNamedNotOptArg,
OverrideFields=defaultNamedOptArg, Overrides=defaultNamedOptArg,
Results=defaultNamedOptArg, Monitor=defaultNamedOptArg):
"""method Subscribe"""
return self._ApplyTypes_(0x1, 1, (24, 0), ((12, 1), (3, 1),
(12, 1), (12, 17), (12, 17), (16396, 18), (12, 17)), 'Subscribe',
None,Security, cookie, Fields, OverrideFields, Overrides, Results,
Monitor)
VB Prog:---------------------
dtStart = CDate((Year(Date) - 1) & "/" & Month(Date) & "," &
Day(Date))
dtEnd = Date
aryFields(0) = 1376
For i = 0 To UBound(vSyms)
sym$ = vSyms(i) & " Index"
'sym$ = "IBM Equity"
BlpData1.GetHistoricalData sym, _
i + 1, _
aryFields, _
dtStart, _
dtEnd
Next i
Python:---------------------
#BLP.Subscribe(vSyms[i], i, aryFields, )
#BLP.GetHistoricalData(vSyms[i], i, aryFields,
D.DateTime(2000,12,12).COMDate(), D.DateTime(2000,12,22).COMDate())
#bt = pythoncom.MakeTime(time.time()-3000000)
#et = pythoncom.MakeTime(time.time())
bt = pywintypes.Time(time.time()-3000000)
et = pywintypes.Time(time.time())
print bt,et
BLP.Subscribe(vSyms[i], i, aryFields, bt, et)
BLP.Flush()
More information about the Python-list
mailing list