Hi, I'm a long user of JNI (several dll, and even used SWIG) and I
wanted test/use JNA (just a non time critical call), but I got stuck at the
start (and so this is a beginner mistake:-) ). But it seems that I don't
performed the call correctly : most of the time the call seems to block at the
call to Native.loadLibrary, some times it blocks at the function call (that one
I want to use), and rarely the call succeeds. Can someone give an help ?It is
easy to built a test case :- take the test code and its dependencies: Shell32-
add in the following methods to the Shell32 class : public int
SHGetSpecialFolderPathA( // documentation available at
http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx Pointer
hwndOwner, byte[] lpszPath, int csidl, int fCreate );
int SHGetFolderPathA( // another test ... Pointer hwndOwner,
int nFolder, Pointer hToken, int dwFlags, byte[]
pszPath );- use the following main :public static void main(String[] args)
{ byte buffer[] = new byte[3072]; Shell32 shell32 = Shell32.INSTANCE;
for(int i = 0; i < 3072; i++) buffer[i] = 65; // I already tried with a
buffer filled with 0 if (Platform.isWindows()) { int retour =
shell32.SHGetSpecialFolderPathA(Pointer.NULL, buffer, 16, 0);
System.out.println("value : "+Native.toString(buffer)); }}
_________________________________________________________________
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger !
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx