1 message in net.java.dev.jna.users[jna-users] JNA + Windows Mobile + Da...
FromSent OnAttachments
fabi...@itmobile.com.brJun 2, 2009 10:48 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 + Windows Mobile + Datec Printer (DPP 350)Actions...
From:fabi...@itmobile.com.br (fabi@itmobile.com.br)
Date:Jun 2, 2009 10:48:10 am
List:net.java.dev.jna.users

Hi !

I'm java ME developer and I use Creme JVM (CDC), and Pocket PC (WM 5 and WM 6), in most case.

I try use jna for WM (issue 108), for comunicate with the software of printer DPP350 (http://www.datecs.bg/products.php?cat=2&prod_id=162)

The developer (miroslav) from datecs, send me the DatePrinter.h (with all name of methods and code)

The name of library is PrintDriver.dll. This is in the path of my JVM, and in the Windows folder (jn my Pocket PC).

The methods (C) that I need access, is: int PDSDK_OpenPrinter(BOOL bKernelMode, LPCTSTR lpszPrinterName); int PDSDK_PrintTaggedText(LPCSTR lpText, int nTextLength); int PDSDK_ClosePrinter(void);

********** Then, I download the jna-3.0.5 - WinCE.zip, and in the \BINARIES folder, I get the jna.jar, and put in classpath of my application. And copy this jar in classpath in Pocket Pc of my application. And, in \Windows Mobile 5.0 Pocket PC SDK (ARMV4I) I get the jnidispatch.dll and put in classpath in Pocket Pc.

Now, my class in Java, for JNA: package br.com.itMobile.mobile.DatecPrinter;

import com.sun.jna.Library; import com.sun.jna.Native;

public interface Clibrary extends Library { //Clibrary instance = (Clibrary)Native.loadLibrary("/Windows/PrintDriver.dll",Clibrary.class); Clibrary instance = (Clibrary)Native.loadLibrary("PrintDriver",Clibrary.class); int PDSDK_OpenPrinter(boolean bKernelMode, String lpszPrinterName); int PDSDK_PrintTaggedText(String text, int len); int PDSDK_ClosePrinter(); }

Ok, I compile my code (I'm use netbeans 6.5 with NSICom JVM CDC for Windows Mobile). And When my code main, try access my new code to talk qith C library, my application is aborted.. I can't see any log, any exception... *********Main.java*************** String txt = "test printer";

Clibrary.instance.PDSDK_OpenPrinter(false, "");

Clibrary.instance.PDSDK_PrintTaggedText(txt, txt.length());

Clibrary.instance.PDSDK_ClosePrinter();

********

What can I do wrong? anybody can help me?

thanks a lot! Fabio