When I run TlbImp.exe on my COM dll, the IDL following has an array of
longs:

[local] HRESULT SomeMethod ([in] short nNumBlocks, [in, size_is(nNumBlocks)]
long *alBlocks, [out, retval] long *plRetVal);

The output creates this method, with a ref int where the array should be:

int SomeMethod (short nNumBlocks, ref int alBlocks);


I have also tried using 'long alBlocks[]' instead of the pointer, but that
doesn't work either. The [in, size_is(..)] *should* be indicating to TlbImp
that it's an array.

Can this be fixed (besides declaring the interface myself)?
====================================================
Walter Williams
Software Engineer
Sawtooth Software, Inc.
http://www.sawtoothsoftware.com
----------------------------------------------------
"Do, or do not. There is no try."

Re: TlbImp marshals array as single ref by Mattias

Mattias
Thu Jun 23 02:03:57 CDT 2005

>The [in, size_is(..)] *should* be indicating to TlbImp
>that it's an array.

Unfortunately the size_is information isn't stored in the typelib so
it's not available to TlbImp.


>Can this be fixed (besides declaring the interface myself)?

See the section "Conformant C-Style Arrays" at
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconeditinginteropassembly.asp



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Re: TlbImp marshals array as single ref by Walter

Walter
Thu Jun 23 12:00:04 CDT 2005

That article worked, thanks!

====================================================
Walter Williams
Software Engineer
Sawtooth Software, Inc.
http://www.sawtoothsoftware.com
----------------------------------------------------
"Do, or do not. There is no try."


"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:OJd%231F8dFHA.892@tk2msftngp13.phx.gbl...
> >The [in, size_is(..)] *should* be indicating to TlbImp
>>that it's an array.
>
> Unfortunately the size_is information isn't stored in the typelib so
> it's not available to TlbImp.
>
>
>>Can this be fixed (besides declaring the interface myself)?
>
> See the section "Conformant C-Style Arrays" at
> http://msdn.microsoft.com/library/en-us/cpguide/html/cpconeditinginteropassembly.asp
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.