> Hello, simple question (so to say).
> 
> I ham trying to manage interoo for interface arrays.
> 
> This interface definition is not working. It is for a DirectShow
> Interface:
> 
>       [ComVisible(true), ComImport,
>       Guid("56a86892-0ad4-11ce-b03a-0020af0ba770"),
>       InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
>       public interface IEnumPins {
>               [PreserveSig]
>               int Next(
>                       [In] int cPins,
>                       [Out, MarshalAs(UnmanagedType.LPArray,
> SizeParamIndex=2)] out IPin[] ppPins,
>                       [Out] out int pcFetched );
> 
>               [PreserveSig]
>               int Skip( [In] int cPins );
>               void Reset();
>               void Clone( [Out] out IEnumPins ppEnum );
>       }
> 
> When trying to use the next function, I get this error:
> 
>       An unhandled exception of type
> 'System.Runtime.InteropServices.MarshalDirectiveException' occurred in
> thonaconsulting.directshow.dll
>       Additional information: Can not use SizeParamIndex for byref
> array parameters.
> 
> That is sad, because I stop having clues on how to get this out.
> Basically I try to get the next x pins. The 2nd parameter (index 1)
> returns an array to the pints taken, and the third parameter returns
> the number of pins put into the arrray.
> 
> The error appears under .NET framework 1.1 - no way to check 1.0
> easly.
> 
The stack trace shows that the error apears within the marshalling:

   at ThonaConsulting.DirectShow.IEnumPins.Next(Int32 cPins, IPin[]&
ppPins, Int32& pcFetched)
   at
ThonaConsulting.DirectShow.Utilities.FilterUtility.GetPin(IBaseFilter
Filter, PinDirection Direction) in
c:\work\thonaconsulting\directshow\thonaconsulting.directshow\utilities\
filterutility.cs:line 29

> Any clues?
> 
> Thomas Tomiczek
> THONA Consulting Ltd.
> (Microsoft MVP C#/.NET)

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to