Hi Mizan Rahman,
I remembered one of my friend is working exactly on the same problem.That time we used asm code to call functions with vc compiler.Though it is working fine for vc, it is not portable.After searching we found a library called
libffi.This worked well for us.Take a look into that library.download the library,check the examples in
.\testsuite\libffi.call folder.
BTW,the following is asm code we tried.
int fun(int a, int b, int c)
{
int x;
x = a + b + c;
return 0;
}
int main()
{
int x = 9;
int y = 10;
int z = 11;
_asm
{
mov eax,dword ptr [z]
push eax
mov eax,dword ptr [y]
push eax
mov eax,dword ptr [x]
push eax
call fun
add esp,12
}
return 0;
}
If you have any doubts give reply.
-venkatanarayana