HELP REQUESTED - Conversion from MQ4 to MQ5 - Object properties setting


I am having difficulty with the following code:

bool LabelCreate(const string            name="Label",             // label name
                 const int               x=10,                     // X coordinate
                 const int               y=10,                     // Y coordinate
                 const string            text="Теxt",              // text
                 const int               font_size=10,             // font size
                 color                   clr=Yellow,               // text color
                 const string            font="Arial")             // font
   const int         anc=1;                    // label anchoring 1 - left, 2 - right
   long              chart_ID=0;               // chart ID
   int               sub_window=0;             // subwindow index
   ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER; // chart corner for anchoring
   bool              state=false;              // pressed/released
   bool              back=false;               // in the background
   bool              selection=false;          // select to move
   bool              hidden=true;              // hidden in the list of objects
   long              z_order=0;                // priority for mouse click


//--- set label coordinates

The last line:


is throwing the following error (and a bunch of identical errors on 11 other similar statements):

'ObjectSetInteger' - no one of the overloads can be applied to the function call
could be one of 2 function(s)
   built-in: bool ObjectSetInteger(long,const string,ENUM_OBJECT_PROPERTY_INTEGER,long)
   built-in: bool ObjectSetInteger(long,const string,ENUM_OBJECT_PROPERTY_INTEGER,int,long)

I understand that the two calls are distinguished only by the type of the variable immediately after the 


but the documentation is of no help in identifying where I have gone wrong.

I tried changing the type of x to long, and the value to 10.0 which made no difference.

This is my first attempt at converting MQ4 to MQ5 and out of more than 5000 lines of code this error and the 11 identical others are all that remain...

I would be grateful for any pointers.


Cast the int to long.

Doerk Hilger:

Cast the int to long.

Thanks for the input - but no change, still same error message

Andrew Thompson:

Thanks for the input - but no change, still same error message

Show the code that you are using that will compile.

Your bool function does not return a value.