Jump to content
Excelsior Forums

sboone

Members
  • Content count

    0
  • Joined

  • Last visited

    Never

Everything posted by sboone

  1. UNIONS

    How do you define an xFunction structure to represent a C structure that contains a union? Thanks, sboone
  2. Function call problem

    I'm using xFunction to make calls to a DocketPort685 scanner dll. I keep getting a 'Bad Parameter' return value from the function call. I have included some of the code below; can you see anything obviously wrong that I'm doing? By the way, I have the dll and header files for the scanner dll. /* From header files */ typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned long uint32; #if !defined(SICALLTYPE) #define SICALLTYPE #endif #if !defined(SYSCANDLL_API) #define SYSCANDLL_API #endif typedef uint32 SIResult; SYSCANDLL_API SIResult SICALLTYPE SI_ReadImageData(uint8 *buffer, uint32 numberOfLinesToRead, uint32 pageNumber, uint32* numberOfLinesReturned ); /* From my code */ long retlines = 0; long numlinestoscan = 100; long scanthefront = 0; Pointer pretlines = Pointer.createPointerTo(retlines); char[] buffer = new char[48000]; xFunction c = new xFunction(dllName, "long SI_ReadImageData(char*,long,long,long*)"); Pointer pbuffer = (Pointer)Argument.create("char*", buffer); Long r = (Long)c.invoke(pbuffer, new Argument(numlinestoscan), new Argument(scanthefront), pretlines); /* r is always 14 (Bad Parameter) but it does not specify which parameter */ Thanks, S. Boone
  3. Function call problem

    Sorry, found two errors in post; should include following: #if !defined(SICALLTYPE) #define SICALLTYPE __cdecl #endif #if !defined(SYSCANDLL_API) // On Windows/Intel platform, the following ifdef block creates macros which // simplify exporting from this DLL. #ifdef SYSCANDLL_EXPORTS #define SYSCANDLL_API __declspec(dllexport) #else
×