harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [build] Update on my build progress
Date Tue, 06 Nov 2007 12:59:06 GMT
Davanum Srinivas wrote:
> Can you please send me the AWT sample that fails?

The failure is actually in loading the modified Win32Wrapper DLL (which
just happens to be by AWT code).  So here's my simple test:

public class LoadDLL {
    public static void main(String[] args) {
        System.out.println("Loading Win32Wrapper...");
        System.loadLibrary("Win32Wrapper");
        System.out.println("Loaded!");
    }
}

when I run it with the modifications shown below [1], this is what I get
(running with the IBM VM):

Loading Win32Wrapper...
DLL debug: Running intialization
DLL debug: Running attach
DLL debug: Running intialization
DLL debug: Running attach
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at
java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:27)
        at java.lang.reflect.Method.invoke(Method.java:258)
        at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
Caused by: java.lang.UnsatisfiedLinkError: Win32Wrapper (JVMPORT015E
Unable to resolve DLL references - a prerequisite DLL may be missing)
        at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:113)
        at
java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:977)
        at java.lang.System.loadLibrary(System.java:758)
        at LoadDLL.main(LoadDLL.java:6)
        at
java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
        ... 2 more

(Strange that the DLL debug information shows it being initialized twice?)

The error implies that it may be a prereq DLL missing, but when I load
Win32Wrapper into the dependency checker everything looks fine to me.

Like I said, I'm still using Microsoft Visual Studio .NET 2003, and I
have not patched the ATL headers, so I'm not following exactly what you
were doing -- I'm trying to get the code to a point that will work for
both of us.  Unsuccessfully so far.

Regards,
Tim


[1] My patched file:

Index: WinDataTransfer.cpp
===================================================================
--- WinDataTransfer.cpp	(revision 592037)
+++ WinDataTransfer.cpp	(working copy)
@@ -21,8 +21,12 @@
 #include <windows.h>

 #include <atlbase.h>
+#include <objbase.h>
+
+extern CComModule _Module;
+
+#include <atlwin.h>
 #include <atlcom.h>
-#include <atlcoll.h>

 #include <oleidl.h>
 #include <shlobj.h>
@@ -32,9 +36,6 @@

 #pragma comment(lib, "gdi32.lib")

-class AtlModule : public CAtlModuleT<AtlModule{
-} _AtlModule;
-
 #include "WinDataTransfer.h"

 // Data format names
@@ -100,8 +101,19 @@
     return env;
 }

+extern "C"
+BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID
lpvReserved) {
+	printf("DLL debug: Running intialization\n");
+   if (fdwReason == DLL_PROCESS_ATTACH) {
+	   printf("DLL debug: Running attach\n");
+      _Module.Init(NULL, hInstDLL);
+   } else if (fdwReason == DLL_PROCESS_DETACH) {
+	   printf("DLL debug: Running detach\n");
+      _Module.Term();
+   }
+   return TRUE;
+}

-
 JNIEXPORT void JNICALL
 Java_org_apache_harmony_awt_nativebridge_windows_WinDataTransfer_init(
                JNIEnv * env, jclass clazz) {

Mime
View raw message