Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Cannot get JvmList in wpf (.net framework 4.7.2) #26

Open
Nik998Old opened this issue May 24, 2022 · 0 comments
Open

Cannot get JvmList in wpf (.net framework 4.7.2) #26

Nik998Old opened this issue May 24, 2022 · 0 comments

Comments

@Nik998Old
Copy link

Nik998Old commented May 24, 2022

So when I try to run the code in a WinForms-application everything works fine.
When I try to run the same code in a WPF-application, accessBridge.EnumJvms() returns 0.

This is my code:

AccessBridge Java = new AccessBridge();
Java.Initialize();
DoEvents();
var test = Java.EnumJvms();

This is my DoEvents method for wpf (should be equivalent to WinForms Application.DoEvents()):

public static void DoEvents()
{
    Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate {}));
}

test.Count is always 0 in wpf.
Working fine in WinForms.

@Nik998Old Nik998Old changed the title Cannot get JvmList in wpf Cannot get JvmList in wpf (.net framework 4.7.2) May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant