I have tried this a couple different ways. Here are some of the ways is set
it up. And my example is not true to form. I will expain.
1st Way: [MarshalAs(UnmanagedType.AsAny)] object fieldIdSA = new int [8];
2nd Way: object fieldIdSA = new int [8];
The method calls for a ref to the object. so my example should be
mymethod(ref fieldIdSA);
In the example project it works in VB6. If you use the type as Variant. But
if i try to do the same in .NET either C# or VB it does not work???? This
one is stumping me....
"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:eSPH2n8RDHA.940@TK2MSFTNGP11.phx.gbl...[color=blue]
> Bob,
>[color=green]
> >I am trying to write this in C# not VB but i tried it as a last resort to
> >see if i could at least get results.
> >This is an error generated by the control. I am getting a return code of
> >ERROR_WRONG_PARAM_TYPE Type mismatch in parameter
> >this is obvious not much to go on.[/color]
>
> When moving the code from VB6 to VB.NET or C#, did you remember to
> change the array type from Long to Integer/int? I'd expect this to
> work
>
> object MFPrimaryFieldScores = new int[8];
> object MFPrimaryResultData = new string[8];
> int ret = mymethod(MFPrimaryFieldScores,MFPrimaryResultData) ;
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
>
http://www.msjogren.net/dotnet/
> Please reply only to the newsgroup.[/color]