Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

cemu sluzi JDirect

[es] :: Java :: cemu sluzi JDirect

[ Pregleda: 2429 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

mvasicdo
Mladen Vasic
Doboj

Član broj: 104294
Poruke: 226
*.teol.net.



Profil

icon cemu sluzi JDirect01.11.2006. u 13:00 - pre 212 meseci
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.
 
Odgovor na temu

nemnesic
nemnesic
Software Developer
Vranje Florida

Moderator
Član broj: 44355
Poruke: 802
*.com
Via: [es] mailing liste



+64 Profil

icon Re: cemu sluzi JDirect01.11.2006. u 13:20 - pre 212 meseci
http://www.codeguru.com/java/tij/tij0193.shtml


--
 
Odgovor na temu

mvasicdo
Mladen Vasic
Doboj

Član broj: 104294
Poruke: 226
*.teol.net.



Profil

icon Re: cemu sluzi JDirect01.11.2006. u 13:49 - pre 212 meseci
ok, ali opet mi ne resava problem:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: MessageBox
        at Main.MessageBox(Native Method)
 
Odgovor na temu

nemnesic
nemnesic
Software Developer
Vranje Florida

Moderator
Član broj: 44355
Poruke: 802
*.com
Via: [es] mailing liste



+64 Profil

icon Re: cemu sluzi JDirect01.11.2006. u 14:03 - pre 212 meseci
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.
 
Odgovor na temu

mvasicdo
Mladen Vasic
Doboj

Član broj: 104294
Poruke: 226
*.teol.net.



Profil

icon Re: cemu sluzi JDirect02.11.2006. u 07:12 - pre 212 meseci
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 ;-)
 
Odgovor na temu

[es] :: Java :: cemu sluzi JDirect

[ Pregleda: 2429 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.