Java native interface problem

K

Kristian Karl

Hi,

Why does not the code below work...
I'm running int with j2re1.4.2_05, on a Windows 2000 box.

The output is:
Library loaded
java.lang.UnsatisfiedLinkError: MessageBoxA



public class ShowMsgBox extends Object {

static {
System.load("C:/WINNT/system32/USER32.DLL");
}

public static void main(String[] args) {
try
{
ShowMsgBox msg = new ShowMsgBox();
System.out.println( "Library loaded" );
msg.MessageBoxA( 0,
"Created by the MessageBox() Win32 func",
"Thinking in Java", 0);
}
catch (UnsatisfiedLinkError e)
{
System.out.println( e );
}
}
private native int MessageBoxA(int hwndOwner, String text,
String title, int fuStyle);
}

/Regards Kristian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top