可能重复:
What’s the equivalent to IntPtr (C#) in Java?Java等价于IntPtr.ZERO?
是否有相当于Java的C#的IntPtr.ZERO?如果没有,传递给JNA库接口调用时是否有任何方法实现相同的行为?
我使用这个片段代表IntPtr.ZERO:通过成为该的Kernel32 JNA接口?:
boolean CreateProcess(String lpApplicationName, String commandLine,
int processAttributes, int threadAttributes,
boolean inheritHandles, int creationFlags,
IntByReference environment, String currentDirectory,
STARTUPINFO startupInfo, PROCESS_INFORMATION processInformation);
private static final IntByReference ZERO = new IntByReference(0);
我将实现相同的行为如此: CreateProcess(target, null, 0, 0, false, 4, ZERO, null, sInfo, pInfo)
对不起,看起来像是指IntPtr而不是IntPtr.Zero。 –
我不是在寻找相当于_IntPtr_,我需要相当于_IntPtr.ZERO_。 – Jire
我相信'null'通常在JNA中等价使用。 – msandiford