M menneaduplo Member Licensed User Longtime User Oct 14, 2019 #1 Hello all, I need help using a third-party library with B4a. They provided me a minimal library to certify if I could use it with B4a. The sample library should return the uppercase of a string I declared it in the project with... Code: #AdditionalJar: string_converter then I called up the library as follows... Code: Dim Ret As JavaObject Dim Parameters As String = "Test" Ret=Ret.InitializeStatic("com.logamic.converter.StringConverter").RunMethodJO("convertToUpperCase",Array(Parameters)) When I run the program the following error appears: "java.lang.IllegalArgumentException: expected receiver of type com.logamic.converter.StringConverter, but got java.lang.Class <com.logamic.converter.StringConverter>" I attach the sample library. Thanks in advance. Mennea Attachments string_converter.jar string_converter.jar 835 bytes · Views: 655
Hello all, I need help using a third-party library with B4a. They provided me a minimal library to certify if I could use it with B4a. The sample library should return the uppercase of a string I declared it in the project with... Code: #AdditionalJar: string_converter then I called up the library as follows... Code: Dim Ret As JavaObject Dim Parameters As String = "Test" Ret=Ret.InitializeStatic("com.logamic.converter.StringConverter").RunMethodJO("convertToUpperCase",Array(Parameters)) When I run the program the following error appears: "java.lang.IllegalArgumentException: expected receiver of type com.logamic.converter.StringConverter, but got java.lang.Class <com.logamic.converter.StringConverter>" I attach the sample library. Thanks in advance. Mennea
DonManfred Expert Licensed User Longtime User Oct 14, 2019 #2 the class is not an static class Code: Dim Ret As JavaObject Dim Parameters As String = "Test" Log(Ret.InitializeNewInstance("com.logamic.converter.StringConverter",Null).RunMethodJO("convertToUpperCase",Array(Parameters))) Last edited: Oct 14, 2019 Upvote 0
the class is not an static class Code: Dim Ret As JavaObject Dim Parameters As String = "Test" Log(Ret.InitializeNewInstance("com.logamic.converter.StringConverter",Null).RunMethodJO("convertToUpperCase",Array(Parameters)))
M menneaduplo Member Licensed User Longtime User Oct 14, 2019 #3 Thanks a lot. As always, your instructions are accurate Mennea Upvote 0