mremillard Posted May 22, 2012 Share Posted May 22, 2012 (edited) Hello. I searched for previous information on my problem and found nothing so here goes... I am running junits in eclipse (Indigo Service Release 2) under Windows 7. When I make use of a 32 bit JVM and the DLL "AutoItX3.dll" all works fine. But when I try to run the same test with "AutoItX3_x64.dll" and a 64 bit JVM nothing seems to work. In the 64 bit environment calling, say, AU3_WinGetHandle() will cause my JVM to crash. Method AU3_WinExists() never finds any windows. These both work fine when calling them with a 32 bit JVM and the 32 bit DLL. The instance of the DLL is accessed via: AutoItX INSTANCE = (AutoItX) Native.loadLibrary(Context.getAutoItxPath(), AutoItX.class); What should I be changing? Thanks. Michael. Edited May 22, 2012 by mremillard Link to comment Share on other sites More sharing options...
ProgAndy Posted May 22, 2012 Share Posted May 22, 2012 Sorry, my code guesser doesn't work for Java. You'll have to post your failing code. Maybe you are using wrong datatypes. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
mremillard Posted May 23, 2012 Author Share Posted May 23, 2012 Well, let's see... I have: public interface AutoItX extends com.sun.jna.Library, Serializable { AutoItX INSTANCE = (AutoItX) Native.loadLibrary("[The path to the DLL. Either the AutoItX3.dll or AutoItX3_x64.dll]", AutoItX.class); public int AU3_WinExists(String szTitle, String szText); public void AU3_WinGetHandle(String szTitle, String szText, byte[] szRetText, int nBufSize); etc... } Then in a junit I'll have: static AutoItX lib = AutoItX.INSTANCE; etc... lib.AU3_WinGetHandle("", "", buf, buf.length); etc... if (lib.AU3_WinExists(pTitle, "") == 1) { ... } else { ... } and so on. This very same code works when in a 32bit JVM using the AutoItX.dll but fails when in a 64bit JVM using the AutoItX_x64.dll. Note: Loading the AutoItX.dll in a 64bit JVM doesn't work. Michael Link to comment Share on other sites More sharing options...
trancexx Posted May 23, 2012 Share Posted May 23, 2012 Could you rephrase the last two sentences so that it's clear what works and what doesn't. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
mremillard Posted May 24, 2012 Author Share Posted May 24, 2012 When I make use of a 32 bit JVM and the DLL "AutoItX3.dll" all works fine. But when I try to run the same tests with "AutoItX3_x64.dll" and a 64 bit JVM nothing seems to work. In the 64 bit environment calling AU3_WinGetHandle() will cause my JVM to crash. In the 64 bit environment calling AU3_WinExists() will never find any windows. These two methods work fine when called with a 32 bit JVM and the 32 bit DLL. That can't be that much clearer... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now