External Dll pass double by reference New comment Mauro Destro 2007.09.25 16:59 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 How to free a string returned to expert from external dll Having a problem with DLL trying to return several values. Please help. How to send string from DLL to my EA? Slava 2007.09.25 17:55 #1 Pass 1item array instead of reference. See https://docs.mql4.com/basis/variables/extfunctions New comment
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