From: Miquel on
Hello,
I am working in Matlab with MEX files.
When I try to return to Matlab from the MEX file with any function like mexCallMATLAB, mexEvalString.. I have a Stack Overflow Error. I think this is a problem of calling conventions. 
The MEX file is configuring an analog device to adquire data. Every time an event happen, full input buffer, a function with _cdecl calling convention is executed, inside this function the unique function which return to Matlab and no crashes is mexPrintf. I think this is because printf is a variadic function and only support __cdecl calling convention. I do not know which calling conventions are using mexCallMATLAB, mexEvalString.. and so on.
Can you provide me any help with this issue?

Thank you in advance,

Miquel