serge.weinst...@barclayscapital.com schrieb: > Hi Thomas, > > Looking at the MSDN documentation for SafeArrayCreate > (http://msdn.microsoft.com/en-us/library/ms893380.aspx), I've found > that: "Neither VT_ARRAY nor the VT_BYREF flag can be set" whatever the > referenced type.
Yes, but the docs for SafeArrayCreateEx or SafeArrayCreateVectorEx do NOT have such a notice. Whatever that means. > After discussion, I've found that it's a mistake in the IDL, it should > have been "SAFEARRAY(VARIANT)" and not "SAFEARRAY(VARIANT*)". > > Unfortunatly, I can't change the existing code. > In fact, I don't need to use this particular object but I need to use > other objects defined in the same type library. The problem is that when > I try to import the type library with "comtypes.client.GetModule", an > exception is thrown when processing this particular method. > > Is there a way to get around it? Maybe by interpreting > "SAFEARRAY(VARIANT*)" as "SAFEARRAY(VARIANT)"? An easy fix is to insert this line POINTER(VARIANT): VT_BYREF|VT_VARIANT, into the definition of the _ctype_to_vartype dictionary, at the end of the comtypes\automation.py module. This will let you import the typelib, but you will get an error if you want to call a method that uses such an argument type. 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