Re: Jawin-Calling a DLL Entry Point
Hua Fang <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hello Morten,
Thank you very much for your reply. My Jawin program looks like this:
int size = 512;
Byte[] errorbuffer = new Byte[(size+1)*2];
String datasetxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n" +
"<!--3/15/2002 2:08:59 PM-->\n" +
"<FormsMergeData> \n" +
"<FormSet name=\"PRINTPREVIEW\" dir=
"C:\\temp\\\"></FormSet> \n" +
" <PageData> \n" +
" </PageData> \n" +
"</FormsMergeData>";
String pdfname = "C:\\temp\\PrintPreview.pdf";
FuncPtr mypreview = null;
try {
mypreview = new FuncPtr("merge.dll", "mergefromxmlW");
NakedByteStream nbs = new NakedByteStream();
LittleEndianOutputStream leos = new LittleEndianOutputStream(nbs);
leos.writeInt(size);
leos.writeStringUnicode(datasetxml);
leos.writeStringUnicode(pdfname);
byte[] response = mypreview.invoke("AIGG::n4", 16, nbs, null,
ReturnFlags.CHECK_NONE);
...}
Our UI team calls mergefromxmlW function in merge.dll that created by the
Server team.The UI pass an error buffer, error buffer size, datasetxml
string and pdf output filename string as [in] parameter. The Server needs
to load the dataset XML and the other XML such as codepages.xml and
perform the merge. If the merge is success, a pdf file should be generated.
Assume the instruction string "AIGG::n4" I wrote is correct, now I got the
following exception:
Exception in thread main:java.lang.NoSuchMethodError:
org.jawin.COMError:method <init>()V not found.
I tried to unzip Jawin.jar and look at the method inside
\org\jawin\COMError.class and found three init method:
[0]<init>, [1]<init> and [2]<init>
Why is Java not able to find method <init>()V? The datasetxml and pdfname
strings don't match with these 3 init methods inside COMError.class? The
Server actually requires the datasetxml and pdfname strings are UTF8, I
didn't do any conversion, because I thought Java is supporting Unicode.
Any suggestions are very much appreciate it.
Thanks/Hua