Hi Tim,

Thanks for the pointer! I'll let the maintainers of this software know.

Do you know if applying this fix is sufficient for win32com to successfully
handle returned structs?

-Terry

On Mon, Apr 27, 2020 at 11:32 PM Tim Roberts <t...@probo.com> wrote:

>
> On Apr 27, 2020, at 12:58 PM, Terry Davis <terry.y.da...@gmail.com> wrote:
> >
> > I looked in the generated file, and its RecordMap dict was empty, with a
> comment. There are a dozen or so structs that should be available to the
> interface. Is there any workaround for this, such as manually defining each
> com_record?
> >
> > RecordMap = {
> > ###'LegacyMicroSamplerInfo': '{00000000-0000-0000-0000-000000000000}', #
> Record disabled because it doesn't have a non-null GUID
> > }
> >
> > I was also given an idl file, which includes record definitions, like
> this one:
> >
> > typedef struct SoftwareInfo {
> >    BSTR name;
> >    BSTR version;
> > } SoftwareInfo;
> >
> > Is there something missing from the idl file that's causing these to be
> missed by win32com?
>
> Well, yes.  There are rigid rules for writing IDL to make a valid dispatch
> interface, and generic structs like that are not in those rules.  Some
> people get the idea that anything they can express in C++ can be shoved in
> a COM interface, but it ain’t so.
>
> You should be able to add a GUID attribute to the IDL:
>
> [ uuid(12345678-1234-1234-1234-123456789ABC) ]
> typedef struct SoftwareInfo {
> …
> } SoftwareInfo;
>
> Just generate a new GUID for each one.
> —
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to