Download MetaTrader 5

arrays are passed by reference only error

To add comments, please log in or register
Richard
79
Richard  

I am converting a build 509 indicator to 610 and am getting the error: "arrays are passed by reference only" for lpRect in GetClientRect. How can I fix it?

int GetClientRect(int hWnd,int lpRect[]);

Carl Schreiber
6689
Carl Schreiber  
rwbta:

I am converting a build 509 indicator to 610 and am getting the error: "arrays are passed by reference only" for lpRect in GetClientRect. How can I fix it?

int GetClientRect(int hWnd,int lpRect[]);


You can't fix that - it's a new feature (no alternative - as far as I know)!

What you get is a warning not an error!

Be clear by changing you code:

int GetClientRect(int hWnd,int& lpRect[]);
whroeder1
14779
whroeder1  
rwbta: "arrays are passed by reference only" for lpRect in GetClientRect. How can I fix it?

int GetClientRect(int hWnd,int lpRect[]);

So pass the array by reference
int GetClientRect(int hWnd,int &lpRect[]);
Richard
79
Richard  
gooly:

You can't fix that - it's a new feature (no alternative - as far as I know)!

What you get is a warning not an error!

Be clear by changing you code:


It is an error in my 610 version of MetaEditor. Changing the code does fix it; so there is a fix. You sound as frustrated by the new version as I am.
Richard
79
Richard  
WHRoeder:
So pass the array by reference

Thank you for the clarification. All is well with the world again; until the next new feature ;-).
joi
89
joi  
Hi, how to pass Arrays to a DLL? DLL do not allow (and is not able) to pass anything by reference.
whroeder1
14779
whroeder1  
joi: how to pass Arrays to a DLL? DLL do not allow (and is not able) to pass anything by reference.
Mql4=reference c++=pointer
To add comments, please log in or register