3F / DllExport

.NET DllExport with .NET Core support (aka 3F/DllExport aka DllExport.bat)
MIT License
960 stars 133 forks source link

about Regex and List #222

Closed redaelyks closed 3 months ago

redaelyks commented 1 year ago

. . .

The question is related to:

DllExport: 1.7.4 Used Visual Studio / MSBuild: vs2017 DllType: netstandard 2


my simple DLL with that code: `using System.Text.RegularExpressions; using System.Runtime.InteropServices;

namespace ClassLibrary1 { public class Class1 { [DllExport] public static bool example(string hex) { return Regex.IsMatch(hex, "[A-Fa-f0-9]{2}"); }

}

}`

JAVA call dll by JNA,but got this: Exception in thread "main" java.lang.Error: Invalid memory access at com.sun.jna.Native.invokeInt(Native Method) at com.sun.jna.Function.invoke(Function.java:418) at com.sun.jna.Function.invoke(Function.java:361) at com.sun.jna.Library$Handler.invoke(Library.java:270) at $Proxy0.example(Unknown Source) at App.main(App.java:9) I think the problem is with the regex.What I want to ask is how to use Regex and List?

3F commented 1 year ago

Hello,

Did you try to rebase system object? Did you check the same issue #125 ? In case to inform something new, please add more information as it says in the issue template. Thanks!

Personally I don't see the problem for Regex.IsMatch() using netstandard2

I've checked your code quickly via C#

using dynamic l = new ConariX("ClassLibrary1.dll");
bool r = l.example<bool>("3F"); // OK, returns true

but it should be the same for JNA if Compiler.rSysObj=True

On 28.04.2023 7:20, redaelyks wrote:

. . .

The question is related to:

DllExport: 1.7.4 Used Visual Studio / MSBuild: vs2017 DllType: netstandard 2


my simple DLL with that code: `using System.Text.RegularExpressions; using System.Runtime.InteropServices;

namespace ClassLibrary1 { public class Class1 { [DllExport] public static bool example(string hex) { return Regex.IsMatch(hex, "[A-Fa-f0-9]{2}"); }

|} |

}`

JAVA call dll by JNA,but got this: Exception in thread "main" java.lang.Error: Invalid memory access at com.sun.jna.Native.invokeInt(Native Method) at com.sun.jna.Function.invoke(Function.java:418) at com.sun.jna.Function.invoke(Function.java:361) at com.sun.jna.Library$Handler.invoke(Library.java:270) at $Proxy0.example(Unknown Source) at App.main(App.java:9) I think the problem is with the regex.What I want to ask is how to use Regex and List?

3F commented 3 months ago

Closed due to inactivity. Please provide further details if the problem still exists.