6 messages in net.java.dev.jna.users64bit support and last error windows
FromSent OnAttachments
Daniel KaufmannJun 10, 2007 5:41 pm 
Timothy WallJun 10, 2007 6:47 pm 
张久安Jun 10, 2007 7:40 pm 
Timothy WallJun 10, 2007 8:20 pm 
Daniel KaufmannJul 12, 2007 6:20 am.java
Timothy WallJul 12, 2007 8:25 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:64bit support and last error windowsActions...
From:Daniel Kaufmann (dani@gmail.com)
Date:Jun 10, 2007 5:41:16 pm
List:net.java.dev.jna.users

Hello,

I have a couple of doubts and want to check if someone here can help me. I was wandering if it is possible to use the same declaration of a function in 32 bits and 64 bits even that the size of the parameter is variable. For pointers I think I can just use pointers, but if it is an int, that will be 32 bits in a 32 bits platform and 64 bits in a 64 bits platform. In the page I saw "Native long support (32- or 64-bit as appropriate) " but not sure if it is this, or how to use this as couldn't find an example.

I also have been calling window api function and I found that I am not able to get the last error code when a function fails , GetLastError() is always returning 0. I am testing in Windows XP professional and sun java 1.5 .0_07. At least it is happening for function CreateProcessA, I think I also got the same behaviour with SetParent function. In VB and in the same happens when you call this kind of function because the code internally might call some other windows function that might set last error to 0, so they provide LastDllError property in Err object to get the last error after calling a native function, instead of GetLastError(). For .Net seem to be the same (need to use SetLastError field in method signature and then use Marshal.GetLastWin32Error ).Is it happening the same here? Is there any way to get the last error?

Thanks in advance. Regards, Daniel