Jawin-Calling a DLL Entry Point

Hua Fang <[email protected]>
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <LISTSERV%[email protected]>
All Jawin experts:

I am trying to write Java code to call the fucntion of native DLL.

Here is the signature of C function:

  void CALLING_CONVENTION mergepreviewfromxmlW (
 WCHAR* errorbuffer,
 int iChars,
 const WCHAR* datasetxml,
 const WCHAR*  outputfile=PDFOUTPUT_W);

the error buffer is passed to the function and iChars indicates the number
of characters the buffer can hold.  The dll writes the error string to the
buffer and I need to get the string back.By calling this function, a pdf
file should be generated.

I wrote the generic invoke code as follows:

byte[] response = myFuncPtr.invoke("AIGG::n4", 16, nbs, null,
ReturnFlags.CHECK_NONE);

The program is running without error, but no pdf file is generated.
Do I write the instruction string "AIGG::n4" correctly?

If I add the following code to figure out the error:

ByteArrayInputStream bais = new ByteArrayInputStream(response);
LittleEndianInputStream leis = new LittleEndianInputStream(bais);
String error = leis.readUnicodeString();
System.out.println(error);

the error was printed as 'NULL'.

I would appreciate it if any Jawin experts can help me to figure out the
right instruction string.

Thanks/Hua
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.