Thank you jcl,

That was helpful but I need some more information, let me clarify:
I want the user of my plugin to be able to pass any function pointer (to a function with ANY signature) to C++, so I use a void* for this.

In C++, I want to call this function with parameter data that I received over the internet. This parameter data is stored as a char array. Now I want to call the function pointer and pass the parameter data *without knowing the function signature* (I only know the length in bytes of the parameter list). The parameter data has the correct length in bytes, so it just has to be copied to the stack at the location where the Lite-C function expects the first parameter.

I've tested this C++ function:
Code:

struct LargeStruct
{
int a;
int b;
int c;
int d;
};
typedef void (*LiteCFunc)(LargeStruct x);
DLLFUNC void tst(int x, void* funcPtr)
{
LiteCFunc myFunc = static_cast<LiteCFunc>(funcPtr);
LargeStruct x;
x.a = 0;
x.b = x;
x.c = 0;
x.d = 0;
(*myFunc)(x);
}


Called it from Lite-C:
Code:

void testfunc(char x, int y); // function pointer/prototype
void tst(int x, void* funcPtr); // DLL function prototype
tst(100, testfunc);


This results in the Lite-C function testfunc being called with the second parameter set to 100. However, there are 2 problems with this aproach:
-There is a limit to how large (in bytes) a parameter list can be.
-I always have to copy the maximum amount of bytes, and if the function has a shorter parameter list (like above) I will be writing to unknown memory.

Is there a cleaner way to copy the (arbitrary length) parameter data to the stack?