[python-win32] COM server and function parameters
Tim Roberts
timr at probo.com
Wed Oct 15 19:31:40 CEST 2008
ricercar at infinito.it wrote:
> Hi all,
> I still have some problems with my server.
>
> I have a function that should return three parameters defined as:
>
> HRESULT GetInfo([out] BSTR *name, [out] BSTR *version, [out] BSTR
> *description);
>
> If I return a tuple with three string I get an error saying that the number
> of returned parameters is wrong (3 in place of 4). I read this post
> http://markmail.org/message/rjpdosrliyne65fd
> and added a fourth parameter as first one with a 0 value (OK).
> I'm not sure this is a right solution and I'd like to ask if something has
> changed from that post.
>
I would think this is fairly clear. Your function returns four things:
an HRESULT and three strings. That's what your tuple needs to contain.
> Unfortunately I cannot test if the values returned are good since after that
> call I get another call to another function that raise an exception.
> The other function is defined as
>
> HRESULT func2([out] IEnumString ** param1);
>
> I can creat an object that implement IEnumString and return it but after
> that I get a QueryInterface on it with iid set to IID_NULL (a list of 0s).
>
Again, this function returns two things: an HRESULT and an interface.
Are you returning a two-tuple?
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list