日期:2014-05-20 浏览次数:20697 次
public class HelloWorld {
// This is the standard, stable way of mapping, which supports extensive
// customization and mapping of Java to native types.
// BOOL WriteProfileStr(const WCHAR* sSection,const WCHAR* sEntry,const WCHAR* sValue,const WCHAR* sIniPath)
public interface CLibrary extends Library {
CLibrary INSTANCE = (CLibrary)
Native.loadLibrary((Platform.isWindows() ? "c:/forunicode" : "c"),
CLibrary.class);
void printf(String format, Object... args);
public boolean WriteProfileStr(String sSection,String sEntry,String sValue,String sIniPath);
}
public static void main(String[] args) {
// CLibrary.INSTANCE.printf("Hello, World\n");
boolean f = CLibrary.INSTANCE.WriteProfileStr("news", "", "", "C:/newstest.ini");
System.out.println(f);
for (int i=0;i < args.length;i++) {
CLibrary.INSTANCE.printf("Argument %d: %s\n", i, args[i]);
}
}
}