I am trying to call the FindExecutable method in Shell32.dll thro a
java stand alone progam.The code I have written works beautifully in VJ++.But when I run it at Dos prompt, it gives UnsatisfiedLinkError.Perhaps I should write a c function calling this FindExecutable method. And then I call the new c function thro jni in java. Can somebody help me.
The code is as below
class Editor {
public static native int FindExecutable(
String lpFile, String lpDirectory, StringBuffer lpResult);
static {
System.loadLibrary("Shell32");
}
public static void main(String[] args) {
String temp_title="temp1.xls";
StringBuffer result=new StringBuffer(1024);
String temp="c:\\";
try{
int ireturn=new Editor().FindExecutable(temp_title,temp,result);
if(ireturn<32)
System.out.println("not found");
else
System.out.println(result);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}