我试图使用Lotus Notes中的NativeCall dll来调用它。但是,此代码不会运行并抛出
UnsupportedOperationException on NativeCall.init()
因此,我认为dll不是放置的。我把Nativecall.dll放在C:\ Notes文件夹中。我需要把它放在其他地方吗?或者这是正确的,代码本身是错误的。我所说的只是" WindowUtils.isRemote()"印刷线。谢谢。
import com.eaio.*;
import com.eaio.nativecall.IntCall;
import com.eaio.nativecall.NativeCall;
import java.io.*;
class WindowsUtils {
public static final int SM_REMOTESESSION = 4096; // remote session
//Session.getPlatform() = Windows/16 or /32
private WindowsUtils() {}
public static boolean isRemote() throws SecurityException, UnsatisfiedLinkError,
UnsupportedOperationException, IOException
{
NativeCall.init();
ntCall ic = null;
try {
ic = new IntCall("user32", "GetSystemMetrics");
int rc = ic.executeCall(new Integer(SM_REMOTESESSION));
System.out.println(rc);
return true;
//return (rc gt; 0);
}
finally {
if (ic != null) ic.destroy();
}
}
public static void main(String ... args) throws Exception {
System.out.println(WindowsUtils.isRemote());
}
}
答案 0 :(得分:0)
根据评论中提供的信息,问题是无法加载NativeCall.dll,因为它是为Win64编译的,但Notes客户端代码是Win32。即使在SysWOW64仿真下运行,Win32代码也无法加载64位DLL。