在java中怎样调用dll.

wyy17_0 2002-01-22 05:31:31
我用以下的java程序想调用DLL中的函数,但运行时出错。
public class Class1 {
/** @dll.import("c:\windows\system\USER32") */
private static native int MessageBox
(int hwndOwner,String text,String title,int Style);

public static void main(String args[]) {
MessageBox(0,"USER32","No Parent Window",0);
}
}

出错信息为:Exception in thread "main" java.lang.UnsatisfiedLinkError: MessageBox
at Class1.MessageBox(Native Method)
at Class1.main(Class1.java:7)
...全文
35 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧