[python-win32] Re: How to create a com_record?

Roger Upole rwupole at msn.com
Sat Mar 15 00:06:42 CET 2008


Kevin Patterson wrote:

> I found the comtypes equivalent if that helps any. The generated comtypes 
> file looks like this:
>
>    COMMETHOD([dispid(1610743812), helpstring(u'GetInterface() method')], 
> HRESULT, 'GetInterface',
>               ( ['in'], POINTER(GUID), 'riid' ),
>               ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 
> 'ppUnknown' )),
>
> With the above, I'm able to use the comtypes.GUID.GUID structure to pass 
> the information over through the COM. Unfortunately I still can't find the 
> win32com equivalent of > > passing my structure through the COM.
>
> The win32com generated py file is saying that it expects a VT_RECORD, but 
> from above, maybe it should really be expecting a POINTER ? or VT_POINTER 
> ? I tried to > > > modify the win32com generated file to take a VT_PTR but 
> that didn't seem to help. I really don't want to redo my infastructure in 
> comtypes, so if anyone knows the win32com > > equivalent, that would be 
> awesome.
>
> In the meantime, I'll keep digging, and will post if I find more.

One thing to try is using the method without type info at all.
win32com.client.dynamic.DumbDispatch will create a late-
bound COM object.

       Roger







More information about the python-win32 mailing list