From: Thomas H. <th...@ct...> - 2009-11-24 21:05:42
|
Ser...@ba... schrieb: > Hi, > > I'm trying to import a COM type library with the statement > "comtypes.client.GetModule(("{09022755-93B0-4BA8-9593-AC74E4C6EABB}", 1, > 0))" > > The module is correctly generated but when imported, I got an exception > on: > > class > NamedCommandSession(comtypes.gen._00020430_0000_0000_C000_000000000046_0 > _2_0.IUnknown): > _case_insensitive_ = True > u'Named command session interface.' > _iid_ = GUID('{44D908E9-7600-4C9D-ADE7-917D59EEA175}') > _idlflags_ = ['oleautomation'] > NamedCommandSession._methods_ = [ > COMMETHOD([], HRESULT, 'Execute', > ( ['in'], BSTR, 'commandName' ), > ( ['in'], _midlSAFEARRAY(BSTR), 'paramNames' ), > ( ['in'], _midlSAFEARRAY(POINTER(VARIANT)), 'paramValues' > ), > ( ['retval', 'out'], POINTER(BSTR), 'ppResult' )), ] > > The method "midlSAFEARRAY" doesn't handle the safearray with elements of > type POINTER(VARIANT). > > Is there a quick fix for that? I hacked around a little, but failed to create such a safearray. I assume the typecode is VT_BYREF|VT_VARIANT, but calling SafeArrayCreateVectorEx(VT_BYREF|VT_VARIANT, 0, 42, NULL) returns zero (= failure). Do you have some C-example code? -- Thanks, Thomas |