serge.weinst...@barclayscapital.com 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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to