External Dll pass double by reference

 
Hi, i have made a DLL library for an EA.
My exported function is this:

#import "HappyEADLL.dll"
int GetNewPosition(int,string,string,string& sym,string& op, double& price,double& tp,double& sl ,double& ts,double& cl);


but if I call the function I cannot have in each double the value setted by the dll function.

Can you give me and example on how to do this?

Something like this in the DLL crash my MT4:

MT4_EXPFUNC int __stdcall GetNewPosition (int pos_id,const char* user, const char* password, char* symbol,char* postype,double& price,double& tp, double& sl, double& ts, double& close)
{
price++;
return 0;
}


thanks
Mauro
 
Pass 1item array instead of reference. See https://docs.mql4.com/basis/variables/extfunctions
Reason: