Using Windows API

Discussion in 'Java' started by Ken Kast, Apr 12, 2004.

  1. Ken Kast

    Ken Kast Guest

    If this is a duplicate post, I apologize. I originally put it out
    this morn, but it's never shown up.

    I have the following code in my Main class:

    public class Main {
    static {
    System.loadLibrary("kernel32");
    }
    native private static short GetSystemDefaultLangID();

    and in main I have

    ID = GetSystemDefaultLangID(); // Get Language ID for this system

    When it executes this line in debug mode the following exception is
    thrown:

    java.lang.UnsatisfiedLinkError: GetSystemDefaultLangID
    at Main.GetSystemDefaultLangID(Native Method)
    at Main.main(Main.java:92)
    All the right directories are in the PATH variable.

    I am teaching myself Java and this app is a porting of a working one
    originally written in VB .NET, so I know the underlying code is OK.

    Can anyone give me a hint what I'm doing wrong?

    Thanks.
     
    Ken Kast, Apr 12, 2004
    #1
    1. Advertising

  2. Ken Kast wrote:

    > If this is a duplicate post, I apologize. I originally put it out
    > this morn, but it's never shown up.
    >
    > I have the following code in my Main class:
    >
    > public class Main {
    > static {
    > System.loadLibrary("kernel32");
    > }
    > native private static short GetSystemDefaultLangID();
    >
    > and in main I have
    >
    > ID = GetSystemDefaultLangID(); // Get Language ID for this system
    >
    > When it executes this line in debug mode the following exception is
    > thrown:
    >
    > java.lang.UnsatisfiedLinkError: GetSystemDefaultLangID
    > at Main.GetSystemDefaultLangID(Native Method)
    > at Main.main(Main.java:92)
    > All the right directories are in the PATH variable.
    >
    > I am teaching myself Java and this app is a porting of a working one
    > originally written in VB .NET, so I know the underlying code is OK.
    >
    > Can anyone give me a hint what I'm doing wrong?
    >
    > Thanks.


    It did show up, and I gave you an answer.
    Here it is on google:
    http://groups.google.com/groups?selm=fghec.68098$-ops.be

    --
    Kind regards,
    Christophe Vanfleteren
     
    Christophe Vanfleteren, Apr 12, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shlomo Anglister
    Replies:
    1
    Views:
    422
    Default User
    Aug 2, 2004
  2. Praveen, Tayal (IE10)
    Replies:
    0
    Views:
    383
    Praveen, Tayal (IE10)
    Mar 17, 2005
  3. John123

    Profiling API or Membership API

    John123, Oct 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    386
    John123
    Oct 20, 2006
  4. George2

    platform specific API or C standard API

    George2, Nov 12, 2007, in forum: C Programming
    Replies:
    13
    Views:
    759
    Tor Rustad
    Nov 13, 2007
  5. Replies:
    2
    Views:
    158
    bbiker
    Oct 25, 2007
Loading...

Share This Page