[python-win32] Struct datatypes from Com objects

Mark Hammond mhammond at skippinet.com.au
Thu Mar 24 03:29:27 CET 2005


> Is there special usage for instantiating a struct type
> object defined in a com object?
>
> I am working with a com object, and in it is a struct
> datatype, which is later used as a required parameter
> for a method.
>
>
> I cannot seem to be able to instantiate an object of
> this
> type, and this is preventing me from being able to
> call
> the one method I need to call.

See win32com.client.Record, and win32com\test\testvb.py.  In a nutshell:

    s = win32com.client.Record("VBStruct", object)

Will create a struct object called VBStruct, from the typelib that 'object'
is defined in.

Mark



More information about the Python-win32 mailing list