[ mvasicdo @ 01.11.2006. 13:00 ] @
moze li mi neko objasniti sledeci kod:

Code:
public class ShowMsgBox {
  public static void main(String args[]) 
  throws UnsatisfiedLinkError   {
    MessageBox(0,
      "Created by the MessageBox() Win32 func",
      "Thinking in Java", 0);
  }
  /** @dll.import("USER32") */
  private static native int 
  MessageBox(int hwndOwner, String text,
    String title, int fuStyle);
}


da li se ovo odnosi i na dll-ove koje sam ja napravio npr. u visual c++ ili samo na "winapi",

kada mi se izvrsi ovaj kod izbaci mi sledecu gresku:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: MessageBox
        at Main.MessageBox(Native Method)


da li mozda treba importovati odredjene klase ili nesto slicno.
[ nemnesic @ 01.11.2006. 13:20 ] @
http://www.codeguru.com/java/tij/tij0193.shtml


--
[ mvasicdo @ 01.11.2006. 13:49 ] @
ok, ali opet mi ne resava problem:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: MessageBox
        at Main.MessageBox(Native Method)
[ nemnesic @ 01.11.2006. 14:03 ] @
pa nisi procitao do kraja; piste ti tu sve zasto ti se javlja taj
problem evo ti:

Citat:

Finally, you might have noticed the UnsatisfiedLinkError exception in
the declaration of main( ). This exception occurs when the linker is
unable to resolve the symbol for the non-Java function at run-time. This
happens for a number of reasons: the .dll file was not found, it is not
a valid DLL, or J/Direct is not supported by your virtual machine. For
the DLL to be found, it must be in the Windows or WindowsSystem
directory, in one of the directories listed in your PATH environment
variable, or in the directory where the .class file is located. J/Direct
is supported in the Microsoft Java compiler version 1.02.4213 or above,
and in the Microsoft JVM version 4.79.2164 or above. To get the compiler
version number, run JVC from the command line with no parameters. To get
the JVM version number, locate the icon for msjava.dll, and using the
context menu look at its properties.


--
Nemanja D. Nesic -:NEM:-
ITS Jr. Computer Programmer
x7378

-All programmers are playwrights and all computers are lousy actors.
[ mvasicdo @ 02.11.2006. 07:12 ] @
E ovako, inam isntaliran winxpsp2,
sa neta sam skinuo i instalirao Java2EE 5.0 SDK, kako mogu provjeriti koja mi je verzija java compilera i virtual mashine.

U Eclipse-i napravim obican projekat:
Code:
public class Simple
{
    public static void main(String args[])
    {
        try {
            MessageBox(0, "MessageBox successfully called.", "Java", 0);
        } catch (UnsatisfiedLinkError ule) {
            System.err.println("Caught exception: " + ule);
            System.err.println("Probably wrong version of Java compiler.");
        }
    }

    /** @dll.import("USER32") */
    static native int MessageBox(int    hwndOwner,
                                 String text,
                                 String title,
                                 int    style);
}

i ne radi mi.
Sta mi sve dodje uz ovaj SDK, sta jos trebam podesiti da bi mi radio J/Direct, sta jos treba da skinem sa neta ...
Ovo mi je vrlo bitno da rijesim i molio bi ako moze da mi neko pomogne sto prije.
I jos samo nesto, pocetnik sam u javi ;-)