From a223f71c4b71b1836a2e047fdcec6d0ae77f7556 Mon Sep 17 00:00:00 2001 From: Mathias Mehrmann Date: Tue, 22 Mar 2016 01:39:42 +0100 Subject: [PATCH 1/4] correct compile errors, fixed eclipse project files and created build.xml for contrib projects --- contrib/monitordemo/build.xml | 68 +++++++++++++++++++ contrib/msoffice/.classpath | 4 +- contrib/msoffice/build.xml | 68 +++++++++++++++++++ .../COM/util/office/MSOfficeWordDemo.java | 7 +- contrib/native_window_msg/.classpath | 2 +- contrib/native_window_msg/build.xml | 68 +++++++++++++++++++ .../jna/platform/win32/Win32WindowDemo.java | 8 +-- contrib/w32printing/.classpath | 14 ++-- contrib/w32printing/build.xml | 58 ++++++++++++++++ 9 files changed, 278 insertions(+), 19 deletions(-) create mode 100644 contrib/monitordemo/build.xml create mode 100644 contrib/msoffice/build.xml create mode 100644 contrib/native_window_msg/build.xml create mode 100644 contrib/w32printing/build.xml diff --git a/contrib/monitordemo/build.xml b/contrib/monitordemo/build.xml new file mode 100644 index 0000000000..89bf8b46c0 --- /dev/null +++ b/contrib/monitordemo/build.xml @@ -0,0 +1,68 @@ + + + Builds, tests, and runs the project jnacontrib.msoffice. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/msoffice/.classpath b/contrib/msoffice/.classpath index 34c74501c1..0468c66a68 100644 --- a/contrib/msoffice/.classpath +++ b/contrib/msoffice/.classpath @@ -2,7 +2,7 @@ - - + + diff --git a/contrib/msoffice/build.xml b/contrib/msoffice/build.xml new file mode 100644 index 0000000000..ed163ef04c --- /dev/null +++ b/contrib/msoffice/build.xml @@ -0,0 +1,68 @@ + + + Builds, tests, and runs the project jnacontrib.msoffice. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java index f03467993f..8221ca6d44 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java @@ -14,6 +14,8 @@ import java.io.File; +import com.sun.jna.Pointer; +import com.sun.jna.platform.win32.Ole32; import com.sun.jna.platform.win32.COM.COMException; import com.sun.jna.platform.win32.COM.util.Factory; import com.sun.jna.platform.win32.COM.util.office.word.ComIApplication; @@ -40,6 +42,7 @@ public void testMSWord() { ComWord_Application msWordObject = null; ComIApplication msWord = null; Factory factory = null; + Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); try { String tempDir = System.getProperty("java.io.tmpdir"); System.out.println("Files in temp dir: "+tempDir); @@ -101,9 +104,7 @@ public void testMSWord() { if (msWord != null) { msWord.Quit(); } - if (null != factory) { - factory.getComThread().terminate(500); - } } + Ole32.INSTANCE.CoUninitialize(); } } diff --git a/contrib/native_window_msg/.classpath b/contrib/native_window_msg/.classpath index a7dee2db96..819c7b01ad 100644 --- a/contrib/native_window_msg/.classpath +++ b/contrib/native_window_msg/.classpath @@ -3,6 +3,6 @@ - + diff --git a/contrib/native_window_msg/build.xml b/contrib/native_window_msg/build.xml new file mode 100644 index 0000000000..f2aa1212bc --- /dev/null +++ b/contrib/native_window_msg/build.xml @@ -0,0 +1,68 @@ + + + Builds, tests, and runs the project jnacontrib.msoffice. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/native_window_msg/src/com/sun/jna/platform/win32/Win32WindowDemo.java b/contrib/native_window_msg/src/com/sun/jna/platform/win32/Win32WindowDemo.java index 2e9e962d88..df794ac493 100644 --- a/contrib/native_window_msg/src/com/sun/jna/platform/win32/Win32WindowDemo.java +++ b/contrib/native_window_msg/src/com/sun/jna/platform/win32/Win32WindowDemo.java @@ -13,27 +13,21 @@ package com.sun.jna.platform.win32; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.DBT; import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_DEVICEINTERFACE; import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_HANDLE; import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_HDR; import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_OEM; import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_PORT; import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_VOLUME; -import com.sun.jna.platform.win32.Kernel32; -import com.sun.jna.platform.win32.User32; import com.sun.jna.platform.win32.WinDef.HMODULE; import com.sun.jna.platform.win32.WinDef.HWND; import com.sun.jna.platform.win32.WinDef.LPARAM; import com.sun.jna.platform.win32.WinDef.LRESULT; import com.sun.jna.platform.win32.WinDef.WPARAM; -import com.sun.jna.platform.win32.WinUser; import com.sun.jna.platform.win32.WinUser.HDEVNOTIFY; import com.sun.jna.platform.win32.WinUser.MSG; import com.sun.jna.platform.win32.WinUser.WNDCLASSEX; import com.sun.jna.platform.win32.WinUser.WindowProc; -import com.sun.jna.platform.win32.Wtsapi32; // TODO: Auto-generated Javadoc /** @@ -46,7 +40,7 @@ public class Win32WindowDemo implements WindowProc { */ public Win32WindowDemo() { // define new window class - WString windowClass = new WString("MyWindowClass"); + String windowClass = new String("MyWindowClass"); HMODULE hInst = Kernel32.INSTANCE.GetModuleHandle(""); WNDCLASSEX wClass = new WNDCLASSEX(); diff --git a/contrib/w32printing/.classpath b/contrib/w32printing/.classpath index fb565a588d..d99ea82811 100644 --- a/contrib/w32printing/.classpath +++ b/contrib/w32printing/.classpath @@ -1,6 +1,8 @@ - - - - - - + + + + + + + + diff --git a/contrib/w32printing/build.xml b/contrib/w32printing/build.xml new file mode 100644 index 0000000000..0f812471fb --- /dev/null +++ b/contrib/w32printing/build.xml @@ -0,0 +1,58 @@ + + + Builds, tests, and runs the project jnacontrib.msoffice. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1174c0f125b6679ba8349133b029d94aab5474c4 Mon Sep 17 00:00:00 2001 From: Mathias Mehrmann Date: Tue, 22 Mar 2016 02:03:23 +0100 Subject: [PATCH 2/4] corrected description in build.xml --- contrib/native_window_msg/build.xml | 2 +- contrib/w32printing/build.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/native_window_msg/build.xml b/contrib/native_window_msg/build.xml index f2aa1212bc..5a2098287c 100644 --- a/contrib/native_window_msg/build.xml +++ b/contrib/native_window_msg/build.xml @@ -1,6 +1,6 @@ - Builds, tests, and runs the project jnacontrib.msoffice. + Builds, tests, and runs the project jnacontrib.native_window_msg. diff --git a/contrib/w32printing/build.xml b/contrib/w32printing/build.xml index 0f812471fb..c7acee12d9 100644 --- a/contrib/w32printing/build.xml +++ b/contrib/w32printing/build.xml @@ -1,6 +1,6 @@ - Builds, tests, and runs the project jnacontrib.msoffice. + Builds, tests, and runs the project jnacontrib.w32printing. From 91035ab51cd0f1d0cca36aeb801ef0aede771f77 Mon Sep 17 00:00:00 2001 From: Mathias Mehrmann Date: Tue, 22 Mar 2016 02:20:17 +0100 Subject: [PATCH 3/4] corrected build.xml description --- contrib/monitordemo/build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/monitordemo/build.xml b/contrib/monitordemo/build.xml index 89bf8b46c0..4af4dfd1fd 100644 --- a/contrib/monitordemo/build.xml +++ b/contrib/monitordemo/build.xml @@ -1,6 +1,6 @@ - Builds, tests, and runs the project jnacontrib.msoffice. + Builds, tests, and runs the project jnacontrib.monitordemo. From 1d210b4cf5895fc56c7ed6f3c460621a5fddde33 Mon Sep 17 00:00:00 2001 From: Mathias Mehrmann Date: Tue, 22 Mar 2016 02:24:17 +0100 Subject: [PATCH 4/4] created eclipse project files for monitordemo --- contrib/monitordemo/.classpath | 8 ++++++++ contrib/monitordemo/.project | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 contrib/monitordemo/.classpath create mode 100644 contrib/monitordemo/.project diff --git a/contrib/monitordemo/.classpath b/contrib/monitordemo/.classpath new file mode 100644 index 0000000000..e2935f9482 --- /dev/null +++ b/contrib/monitordemo/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/contrib/monitordemo/.project b/contrib/monitordemo/.project new file mode 100644 index 0000000000..85b55e03af --- /dev/null +++ b/contrib/monitordemo/.project @@ -0,0 +1,17 @@ + + + monitordemo + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + +