Fife Common Windows File IO Extrad

Questions on using RText should go here.

Moderator: robert

Fife Common Windows File IO Extrad

Postby groggy » Wed Jul 31, 2013 10:25 pm

I'm tryinh to use the to native libraries from fife.vommon ib one of my projects. But i cannot rub my small program:

java code:

package org.fife.ui.rtextfilechooser.extras;

/*
* Tried to move it in the package org.fife.ui.rtextfilechooser.extras(maybe the native part didn't
* find the entry point) -> again error...
*
* Tried it in custom package -> error..
*
* Arch: x86 -> loading the right dll
*/
public class Main {

public static void main(String[] args) {
// the library is loaded...
System.loadLibrary("Win32FileIOExtras");
Main m = new Main();
// The path is correct, checked it 10 times :D
String[] s = new String[] { "C:\\Dokumente und Einstellungen\\kind\\Desktop\\INFORMATIK_2\\Common\\src\\org\\fife\\ui\\rtextfilechooser\\extras\\package.html" };

m.moveToRecycleBinImpl(0, s, true, true);
/*
* ERROR: Exception in thread "main" java.lang.UnsatisfiedLinkError:
* org.fife.ui.rtextfilechooser.extras.Main.moveToRecycleBinImpl(J[Ljava/lang/String;ZZ)Z at
* org.fife.ui.rtextfilechooser.extras.Main.moveToRecycleBinImpl(Native Method) at
* org.fife.ui.rtextfilechooser.extras.Main.main(Main.java:11)
*/

m.showFilePropertiesDialogImpl(0, s[0]);
/*
* ERROR: Exception in thread "main" java.lang.UnsatisfiedLinkError:
* org.fife.ui.rtextfilechooser
* .extras.Main.showFilePropertiesDialogImpl(JLjava/lang/String;)Z at
* org.fife.ui.rtextfilechooser.extras.Main.showFilePropertiesDialogImpl(Native Method) at
* org.fife.ui.rtextfilechooser.extras.Main.main(Main.java:10)
*/
}

/*
* Copied from Win32FileIOExtras
*/
protected native boolean moveToRecycleBinImpl(long hwnd, String[] files, boolean confirmation,
boolean silent);

/*
* Copied from Win32FileIOExtras
*/
protected native boolean showFilePropertiesDialogImpl(long hwnd, String file);
}

I always get a UnsatisfiedLinkError buz don't no why...
Hope you can help me...

Are these libraries yours? If yes can i use them in my project? Unser which licence are they published?
groggy
 
Posts: 34
Joined: Sun Feb 17, 2013 1:11 am

Re: Fife Common Windows File IO Extrad

Postby groggy » Tue Aug 06, 2013 12:12 pm

Found out that the classes have to have to same name as the native libraries and have to be in the package org.fife.rtextfilechooser.extras. Is it possible to change that?
groggy
 
Posts: 34
Joined: Sun Feb 17, 2013 1:11 am

Re: Fife Common Windows File IO Extrad

Postby robert » Tue Aug 06, 2013 1:04 pm

Aye, that's the way JNI works. It creates native implementations for methods, and uses the package naming convention to make sure they are unique. If you want to put them into a different package you'd have to build them yourself (run javah, fill in the implementations for each method, rebuild).

I just realized that I never published the source for those native bits. Let me know if you'd like me to publish them, and I'll find a place to stick 'em.
User avatar
robert
 
Posts: 801
Joined: Sat May 10, 2008 5:16 pm

Re: Fife Common Windows File IO Extrad

Postby groggy » Tue Aug 06, 2013 2:26 pm

That would be awesome :D i've never written stuff in c/c++ so i have to learn it first befor i can do the native stuff.

These to natives are published under modified BSD licence as well arent't they?
groggy
 
Posts: 34
Joined: Sun Feb 17, 2013 1:11 am

Re: Fife Common Windows File IO Extrad

Postby robert » Wed Aug 07, 2013 1:28 am

Yes, when I release the source it'll be modified BSD.
User avatar
robert
 
Posts: 801
Joined: Sat May 10, 2008 5:16 pm

Re: Fife Common Windows File IO Extrad

Postby groggy » Wed Aug 07, 2013 2:14 am

Would be fine if you could release them soon. Kind of svn push...
groggy
 
Posts: 34
Joined: Sun Feb 17, 2013 1:11 am


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests