Kurzes googlen sagt mir, dass man bei JNI/ENI die native Library auch selbst implementieren und dann auf den Java-Code mappen muss, verstehe ich das richtig? Dann wäre es natürlich schlecht mit dem Aufrufen bestehender Methoden. Sorry, falls die Frage dumm ist, aber ich komme aus der .NET-Ecke und da braucht man das für Interop nicht...pfeffer schrieb:Das scheint mir eine super Idee zu sein!Silas schrieb:Ggf. könnte man auch ENI nutzen, um das Problem zu umgehen, aber da bräuchten wir auch eine native DLL für WinCE (also jemanden mit Compiler). Oder kann man mit ENI auch direkt auf die coredll.dll zugreifen, um CreateProcess aufzurufen?
Gruß,
Pfeffer.
static {ewe.sys.Vm.loadLibrary("CWWrapper");}
private static native void ppcExec(String cmd, String arg);
//########################################################################
/*
To compile this under Windows, select a project that produces a Win32 or WinCE
Dynamic Linked Library.
To compile under Linux use the -shared option with the gcc compiler
to produce a shared library.
e.g.
gcc -shared -o MyNativeLibrary.so ThisFile.cpp
If you define NO_ENI_THREADS then you will not need the pthread.so library to run it under LInux.*/
#ifdef _WIN32_WCE
#define NO_JNI_METHODS
#endif
//
//Other possible definitions:
//#define NO_EWE_METHODS
//#define NO_JNI_METHODS
//#define NO_ENI_THREADS
//
// Keep the eni.h file along with this file.
#include "eni.h"
//########################################################################
/**
Implement this function: CWWrapper.ppcExec()
**/
//===================================================================
void CWWrapper_ppcExec(object_access &obj,ObjectRef par1,ObjectRef par2)
//===================================================================
{
}
//..................................................................
extern "C" {
EWEEXPORT void EWECALL Eni_CWWrapper_ppcExec(ClassRef clazz,JValue * pars)
{
ewe_object eo(Eni);
CWWrapper_ppcExec(eo.setClass(clazz),pars[0].l,pars[1].l);
}
#ifndef NO_JNI_METHODS
JNIEXPORT void JNICALL Java_CWWrapper_ppcExec(void *Jni,ClassRef clazz,ObjectRef par1,ObjectRef par2)
{
java_object jo(Jni);
CWWrapper_ppcExec(jo.setClass(clazz),par1,par2);
}
#endif //NO_JNI_METHODS
} //extern "C"
//..................................................................
Building the release VM involves the following steps:
1. Compile the Ewe class library as necessary. The library is in the vm_classes directory.
2. Use Jewel to create the ewe.ewe file for that platform. The EweConfig.ewe file is already provided for you and should not be changed.
3. Build the MakePool utility for the Windows desktop.
4. Use MakePool to convert ewe.ewe into a Class Pooled version (explained below).
5. Build the executable that optionally will link with the Class Pooled ewe.ewe and EweConfig.ewe.
Steps 3 and 4 are optional and can be skipped if you are in the process of modifying or debugging the VM. However it is recommended that you do them for final production versions of the VM. These two steps involve “Class Pooling” – which will be explained in a later section.