InvalidOleVariantTypeException

Hi,
the following code when run, produces this InvalidOleVariantTypeException

Unbenannt 1.bugreport.zip (7.4 KB)

WaterException.txt (300 Bytes)

it seems the compiler emits wrong code.
It is a long standing problem for me, which i have circumvent by using an old version of the compiler (Version 7.2.77.1621 from 2012)
(I need this kind of code for my debugger)
It would be nice to have this solved so that i can completely switch to the actual compiler.
Thanks

Andreas,

could it be that this declaration is incorrect:

    function Next([&In] celt:Cardinal;
                  [&Out, MarshalAs(UnmanagedType.LPArray, ArraySubType := UnmanagedType.IUnknown)] rgelt: array of Object;
                  [&Out] out pceltFetched:Cardinal):Integer;

The 2nd parameter has attribute out but it is declared w/o out modifier.

I’ve changed/added every missing out modifier. But no luck…

Hi,

I’ve updated your declaration to

    function Next([&In] celt:Cardinal;
                  [&Out] out rgelt: ^Void;
                  [&Out] out pceltFetched:Cardinal):Integer; unsafe;

as I can see, code works and returns some value:

Yes, it seems to give some value.
If you’ll find a way to do this without the unsafe modifier (which wasn’t needed with the old compiler) then it would be fine.
Otherwise i would call this a regression…

Hi,

I’ve deleted your IEnumUnknown declaration and used IEnumUnknown type from Microsoft.VisualStudio.OLE.Interop nuget package:

“unsafe” should have no affect on Island, it’s only for .NET.

Thanks for your investigation.
But i don’t want to add an extra (unsafe) assembly.
And i don’t want to rewrite my code.
The old compiler was able to do that correctly, why don’t you accept this as a a bug/regression ?
I can provide you with this version (and also the assembly for il comparision) in case you don’t have this version any more.

Hi,

Logged and fixed as E26941.

Fix will be present in tomorrow’s build

Thanx, that’s great !

Evgeny, i’ve tried to test your solution with the MS interop package, but i’ve got an
error on compiling under 64 bit OS and an error on running on 32 bit OS.
When running on my W10/32 bit OS, it seems the assemblies are not copied into the local bin directory. What do i miss ? Can you send me your project ?
(I get a FileNotFoundException)
When compiling under W10/64 bit OS, i get
E: There was an exception executing the Elements compiler: ‘No path set for EBuildObject Reference: netstandard’

RunException_86.txt (191 Bytes)
Unbenannt_NuGet 1_64.bugreport.txt (17.4 KB)
Unbenannt_NuGet 1_64.bugreport.zip (739.6 KB)

Thank you

Hi,

You haven’t set Copy local:

I can’t reproduce this. in my case all assembles were resolved as

   Reference 'mscorlib' was resolved to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dll' for target 'Echoes'.
   Reference 'System' was resolved to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll' for target 'Echoes'.
   Reference 'netstandard' was resolved to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\netstandard.dll' for target 'Echoes'.
   Reference 'System.Core' was resolved to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Core.dll' for target 'Echoes'.

Thanks, i’ve overlooked the copy local flag. 32 bit now runs fine…

Installing the ref assembies for 4.7.2 solved the problem with the 64 bit OS.
(Although it’s unclear why)
Thanks