25 messages in net.java.dev.jna.users[jna-users] JNA and Windows Mobile
FromSent OnAttachments
Novatchkov HristoFeb 26, 2009 2:14 am 
Timothy WallFeb 26, 2009 5:54 am 
Hristo NovatchkovFeb 27, 2009 4:11 pm 
Timothy WallFeb 27, 2009 7:21 pm 
Hristo NovatchkovFeb 28, 2009 3:03 am 
Timothy WallFeb 28, 2009 4:16 am 
Hristo NovatchkovFeb 28, 2009 4:30 am 
Timothy WallFeb 28, 2009 5:17 am 
Novatchkov HristoMar 4, 2009 3:06 am 
Novatchkov HristoMar 4, 2009 8:13 am 
Timothy WallMar 4, 2009 8:38 am 
Novatchkov HristoMar 5, 2009 12:19 am 
Novatchkov HristoMar 5, 2009 12:59 am 
Timothy WallMar 5, 2009 8:24 am 
Novatchkov HristoMar 10, 2009 7:42 am 
Timothy WallMar 10, 2009 8:21 am 
Novatchkov HristoMar 11, 2009 2:02 am 
Timothy WallMar 11, 2009 5:11 am 
Novatchkov HristoMar 11, 2009 5:56 am 
Timothy WallMar 11, 2009 6:03 am 
Hristo NovatchkovMar 15, 2009 9:05 am 
Timothy WallMar 15, 2009 12:09 pm 
youc...@free.frMar 16, 2009 3:51 am 
Novatchkov HristoMar 16, 2009 4:00 am 
Timothy WallMar 16, 2009 6:17 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] JNA and Windows MobileActions...
From:Novatchkov Hristo (hris@univie.ac.at)
Date:Mar 11, 2009 2:02:29 am
List:net.java.dev.jna.users

But then, what is the Platform.isWindowsCE() function used for?

-----Ursprüngliche Nachricht----- Von: Timothy Wall [mailto:twal@dev.java.net] Gesendet: Dienstag, 10. März 2009 16:22 An: use@jna.dev.java.net Betreff: Re: AW: AW: [jna-users] JNA and Windows Mobile

There is not currently any underlying native support for wince.

On Mar 10, 2009, at 10:42 AM, Novatchkov Hristo wrote:

I have just come across some examples of how to use JNA for different platforms. Accordingly, it is possible to define the needed platform by the following command:

public interface CLibrary extends Library { CLibrary INSTANCE = (CLibrary) Native.loadLibrary((Platform.isWindows() ? "msvcrt" : "c"), CLibrary.class);

void printf(String format, Object... args); }

There seems to be an option to use the Platform.isWindowsCE() function. Isn't there then the possibility to use that function in order to be able to load DLLs also under a Windows Mobile version? How would the code than look like? Similar to the following (assuming that ANT_DLL.dll is the library that I want to call dynamically)? :

public interface ANT_MOD extends Library {

public boolean _ANT_AssignChannel(String ucChannel, String ucChannelTapye, String ucNetworkNumber);

} ... public void init() {

ANT_MOD ant_mod = (ANT_MOD) Native.loadLibrary((Platform..isWindowsCE() ? "ANT_DLL" : "ANT_DLL"), ANT_MOD.class);

Regards, Hristo

-----Ursprüngliche Nachricht----- Von: Timothy Wall [mailto:twal@dev.java.net] Gesendet: Donnerstag, 5. März 2009 17:25 An: use@jna.dev.java.net Betreff: Re: AW: [jna-users] JNA and Windows Mobile

On Mar 5, 2009, at 3:19 AM, Novatchkov Hristo wrote:

I am not sure what you mean by "Chances are you're trying to load the regular w32 dll, rather than one compiled specifically for windows mobile."

Do you mean that I should try to use another jnidispath.dll? E.g. to compile my own jnidispath.dll?

yes, you will need to compile your own jnidispatch.dll, specific to windows mobile. The one in jna.jar is for regular desktop windows.

the main challenge in building for windows mobile will be getting libffi to build for the wince/arm combination. the win64 build is set up to use microsoft tools, and JNA's libffi has been tweaked to facilitate building with microsoft's tools, but there's still significant work to getting libffi built for wince if it hasn't been done already.

-----Ursprüngliche Nachricht----- Von: Timothy Wall [mailto:twal@dev.java.net] Gesendet: Mittwoch, 4. März 2009 17:39 An: use@jna.dev.java.net Betreff: Re: [jna-users] JNA and Windows Mobile

Chances are you're trying to load the regular w32 dll, rather than one compiled specifically for windows mobile.

There is no windows mobile support in the JNA build, you'd have to do it yourself, or find someone else who has done it.

On Mar 4, 2009, at 11:14 AM, Novatchkov Hristo wrote:

Ooo no, I just came across the FAQ at the JNA homepage, saying:

"Does JNA work with J2ME/Windows Mobile? JNA requires Java 1.4 (or greater) and uses (but does not depend on) NIO buffers. A stub NIO buffer implementation may be provided and things should otherwise Just Work.

Windows Mobile is supported by libffi (mingwce) but JNA has not yet been (publicly) built for that target. Nothing technically should prevent it, though."

Since I am not sure, does that mean that it is not possible to use JNA under Windows Mobile? And is that the reason why I get the java.lang.UnsatisfiedLinkError (see e-mail below) on the mobile device?

I hope that is not the case, thanks in advance! Hristo

-----Ursprüngliche Nachricht----- Von: Novatchkov Hristo [mailto:hris@univie.ac.at] Gesendet: Mittwoch, 4. März 2009 12:07 An: use@jna.dev.java.net Betreff: AW: [jna-users] JNA - java.awt Dependency

Thanks for the hints - I am finally able to run my program under the jclDevice emulator in Eclipse. I have also faced some problems deploying and installing the app on my device, which should be solved in the meantime. Right now, though, when I run the program and try to use the JNA libraries and calls, I get the following error:

Mar 4, 2009 11:47:30 AM SystemErr SEVERE: java.lang.UnsatisfiedLinkError: \TEMP\jna63786.tmp ((-2146893818) Invalid Signature.) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.ClassLoader.loadLibraryWithPath(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.System.load(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at com.sun.jna.Native.loadNativeLibraryFromJar(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at com.sun.jna.Native.loadNativeLibrary(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at com.sun.jna.Native.<clinit>(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.J9VMInternals.initializeImpl(Native Method) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.J9VMInternals.initialize(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at mobile.coaching.InvokeNative.init(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at mobile.coaching.UI $4.widgetSelected(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.reflect.AccessibleObject.invokeL(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.reflect.Method.invoke(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org .eclipse .equinox .internal.app.EclipseAppContainer.callMethodWithException(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org .eclipse .core .runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org .eclipse .core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.reflect.AccessibleObject.invokeL(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.reflect.Method.invoke(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.core.launcher.Main.basicRun(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at org.eclipse.core.launcher.Main.run(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at com.ibm.jxesupport.launcher.Main.main(Unknown Source) Mar 4, 2009 11:47:30 AM org.eclipse.ui SEVERE: Unhandled event loop exception Mar 4, 2009 11:47:30 AM SystemErr SEVERE: Unhandled event loop exception Reason: Mar 4, 2009 11:47:30 AM org.eclipse.ui SEVERE: \TEMP\jna63786.tmp ((-2146893818) Invalid Signature.) java.lang.UnsatisfiedLinkError: \TEMP\jna63786.tmp ((-2146893818) Invalid Signature.) at java.lang.ClassLoader.loadLibraryWithPath(Unknown Source) at java.lang.System.load(Unknown Source) at com.sun.jna.Native.loadNativeLibraryFromJar(Unknown Source) at com.sun.jna.Native.loadNativeLibrary(Unknown Source) at com.sun.jna.Native.<clinit>(Unknown Source) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(Unknown Source) at mobile.coaching.InvokeNative.init(Unknown Source) at mobile.coaching.UI$4.widgetSelected(Unknown Source) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source) at java.lang.reflect.AccessibleObject.invokeL(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org .eclipse .equinox .internal.app.EclipseAppContainer.callMethodWithException(Unknown Source) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source) at org .eclipse .core .runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source) at org .eclipse .core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at java.lang.reflect.AccessibleObject.invokeL(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Unknown Source) at org.eclipse.core.launcher.Main.run(Unknown Source) at com.ibm.jxesupport.launcher.Main.main(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: java.lang.UnsatisfiedLinkError: \TEMP\jna63786.tmp ((-2146893818) Invalid Signature.) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.ClassLoader.loadLibraryWithPath(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at java.lang.System.load(Unknown Source) Mar 4, 2009 11:47:30 AM SystemErr SEVERE: at com.sun.jna.Native.loadNativeLibraryFromJar(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at com.sun.jna.Native.loadNativeLibrary(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at com.sun.jna.Native.<clinit>(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at java.lang.J9VMInternals.initializeImpl(Native Method) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at java.lang.J9VMInternals.initialize(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at mobile.coaching.InvokeNative.init(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at mobile.coaching.UI $4.widgetSelected(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at java.lang.reflect.AccessibleObject.invokeL(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at java.lang.reflect.Method.invoke(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org .eclipse .equinox .internal.app.EclipseAppContainer.callMethodWithException(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org .eclipse .core .runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org .eclipse .core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at java.lang.reflect.AccessibleObject.invokeL(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at java.lang.reflect.Method.invoke(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.core.launcher.Main.basicRun(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at org.eclipse.core.launcher.Main.run(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: at com.ibm.jxesupport.launcher.Main.main(Unknown Source) Mar 4, 2009 11:47:31 AM SystemErr SEVERE: \TEMP\jna63786.tmp ((-2146893818) Invalid Signature.)

Can somebody tell me what's wrong this time? Thanks and best regards, Hristo