Jump to content
Excelsior Forums


  • Content count

  • Joined

  • Last visited


Everything posted by FrankFFM

  1. FrankFFM

    Problems calling GetProcessMemoryInfo

    When I made some experiments with an int[10] instead the structure there was no errorcode (but till now onyl 0 in the array elements). Making the array or the size of the area to store data (third parameter of the DLL call) smaller chause error message on the VM level. So it was the structure bnut I have no idea what's wrong anf why I do not get results back right now. Any ideas now from outer space?
  2. Hi, I have problems calling BOOL WINAPI GetProcessMemoryInfo(__in HANDLE Process,__out PPROCESS_MEMORY_COUNTERS ppsmemCounters,__in DWORD cb) My code: // loop over all processes for (int i=0; i < aProcCount/4;i++) { // HANDLE WINAPI OpenProcess(__in DWORD dwDesiredAccess,__in BOOL bInheritHandle,__in DWORD dwProcessId); cd = new xFunction("Kernel32","int OpenProcess(int,int,int)"); Argument[] pd = new Argument[] {new Argument(0x0410),new Argument(0),new Argument(aProcOut)}; int han = ((Integer)cd.invoke(pd)).intValue(); System.out.println(">>" + han); // BOOL WINAPI GetProcessMemoryInfo(__in HANDLE Process,__out PPROCESS_MEMORY_COUNTERS ppsmemCounters,__in DWORD cb); ce = new xFunction("Psapi","int GetProcessMemoryInfo(int,ProcessMemoryCounter,int)"); ProcessMemoryCounter ppp = new ProcessMemoryCounter(); Argument[] pe = new Argument[] {new Argument(han),new Argument(ppp),new Argument(40)}; if (((Integer)ce.invoke(pe)).intValue() == 0) { // DWORD WINAPI GetLastError(void) cf = new xFunction("Kernel32","int GetLastError()"); int aCode = ((Integer)cf.invoke()).intValue(); System.out.println(">>>" + aCode + " Error"); } else System.out.println(">>>" + aBool); } ProcessMemoryCounter is defined as: public class ProcessMemoryCounter extends Structure { int cb = 40; //DWORD int PageFaultCount; //DWORD int PeakWorkingSetSize; // SIZE_T int WorkingSetSize; // SIZE_T int QuotaPeakPagedPoolUsage; // SIZE_T int QuotaPagedPoolUsage; // SIZE_T int QuotaPeakNonPagedPoolUsage; // SIZE_T int QuotaNonPagedPoolUsage; // SIZE_T int PagefileUsage; // SIZE_T int PeakPagefileUsage; // SIZE_T @Override public String defineLayout() { // TODO Auto-generated method stub return "int cb,int PageFaultCount,int PeakWorkingSetSize,int WorkingSetSize,int QuotaPeakPagedPoolUsage,int QuotaPagedPoolUsage," + "int QuotaPeakNonPagedPoolUsage,int QuotaNonPagedPoolUsage,int PagefileUsage,int PeakPagefileUsage"; } } I always get Error 998 as last error - any ideas why?
  3. FrankFFM

    Problems calling GetProcessMemoryInfo

    I'm now a little bit wiser - a colleague of mine asked: Error 998 is: 998 Invalid access to memory location. ERROR_NOACCESS It appears the application doesn't have the right to access the memory. There may be a permissions issue here. Can you run as administrator or such? Is it kernel level memory you're accessing or user mode? > I think it will be a problem with the structure / the size of the structure. Any ideas around now??
  4. FrankFFM

    Problem with CoreDuo CPUs?

    Hi, if I run my compiled application on a CoreDuo with 2GB physical and 4GB virtual memory after some processing with plenty of GC activity? (file processing, building? of internal data structures, etc.) I receive the out of memory error message. There is still >1GB physical memory free and the swapfile is < 1GB. During processing both processor cernels are highly active (70...100%). If I execute the same programm on my old Athlon or PentiumIV with 768 or 1GB physical RAM it works slow but without any memory problems. Any idea what's going on? To solve this issue will get important for me next 4 week, when the final build has to be delivered. Thank's for your help in advance. By the way I use the 4.5 with the latest patches and a there is a valid support contract.
  5. FrankFFM

    Call DDL vom Excel VB

    I tried to call the Java DDL from Excel VBA. 1) I modified the function in \samples\DDL\imported\dll: public class dllClass { static public String printSomething(String aString) { //System.out.println ("I'm a method from DLL"); return aString + aString; } } 2) I copied dll153.dll into \systems32 directory. 3) I used the following code from Excel VBA to call the function: Option Explicit 'Declare use of DLL Private Declare Function printSomething Lib "dll153.dll" (ByVal v1 As String) As String Private Function test() Dim s As String Dim d As String s = "TestEin" d = printSomething(s) End Function I received the error message (translated from german): RunTimeError 453: DLL-Function not found What went wrong?
  6. FrankFFM

    Call DDL vom Excel VB

    What when the dll is part of an application (java compiled with Excelsior) just to allow other programms to access some functionality provided by the java application?