Hello
When trying to run/load an app translated from c# (csc) i get an TypeLoadException with
“Virtuelle PInvoke-implementierte Methode.” (virtual pinvoke implemented method)
The original C# source is:
namespace Unnamed
{
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public enum ActivateOptions { None = 0x00000000 }
[ComImport, Guid("2e941141-7f97-4756-ba1d-9decde894a3d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IApplicationActivationManager
{
IntPtr ActivateApplication([In] String appUserModelId,
[In] String arguments,
[In] ActivateOptions options,
[Out] out UInt32 processId);
}
[ComImport, Guid("45BA127D-10A8-46EA-8AB7-56EA9078943C")]
public class ApplicationActivationManager : IApplicationActivationManager
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public extern IntPtr ActivateApplication([In] String appUserModelId,
[In] String arguments,
[In] ActivateOptions options,
[Out] out UInt32 processId);
}
class Program
{
public static void Main(string[] args)
{
var appActiveManager = new ApplicationActivationManager();
}
}
}
```
And the (hopefully correct) translated version which causes the error is
```Oxygene
namespace Unnamed;
interface
uses
System.Runtime.InteropServices,
System.Runtime.CompilerServices;
type
ActivateOptions = public enum (None= $00000000);
[ComImport, Guid('2e941141-7f97-4756-ba1d-9decde894a3d'),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
IApplicationActivationManager = public interface
function ActivateApplication([&In] appUserModelId : string;
[&In] arguments : string;
[&In] options : ActivateOptions;
[&Out] var processId : UInt32):IntPtr;
end;
[ComImport, Guid('45BA127D-10A8-46EA-8AB7-56EA9078943C')]
ApplicationActivationManager = public class (IApplicationActivationManager)
public
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType := MethodCodeType.Runtime)]
function ActivateApplication([&In] appUserModelId : string;
[&In] arguments : string;
[&In] options : ActivateOptions;
[&Out] var processId : UInt32):IntPtr; external;
end;
Program = assembly static class
public
class method Main(args:array of string);
end;
implementation
class method Program.Main(args:array of string);
begin
var appActiveManager := new ApplicationActivationManager();
end;
end.
```
Andreas