DllExport icon indicating copy to clipboard operation
DllExport copied to clipboard

about Regex and List

Open redaelyks opened this issue 2 years ago • 1 comments

. . .

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?

redaelyks avatar Apr 28 '23 04:04 redaelyks

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 avatar May 03 '23 22:05 3F

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

3F avatar Jun 10 '24 10:06 3F