how create library

 

hi i want create a library with some function that  create  a button and  other GUI , i have  a main program  call A  and library called  B    in  program A i call with include my libraryB.mqh, inside of them  i  want create  a function called 

GuciCtrlButton(string SymbolBut, string NameBut ,string NameText, int xWdit, int yWdit, int xSize, int ySize)
{
 ObjectCreate(SymbolBut,NameBut,OBJ_BUTTON,0,0,0);
  
   //set distance from border x
   ObjectSetInteger(SymbolBut,NameBut,OBJPROP_XDISTANCE,xWdit);
   // set width
   ObjectSetInteger(SymbolBut,NameBut,OBJPROP_XSIZE,xSize);
   // set distance fromborder y
   ObjectSetInteger(SymbolBut,NameBut,OBJPROP_YDISTANCE,yWdit);
   // set hight
   ObjectSetInteger(SymbolBut,NameBut,OBJPROP_YSIZE,ySize);
   // set chart corner 
   ObjectSetInteger(SymbolBut,NameBut,OBJPROP_CORNER,4);
   // set button
   ObjectSetString(SymbolBut,NameBut,OBJPROP_TEXT,NameText);
}

but  before  GuictrlButton ()  what i must insert ??  and  will be correct  the function ? thanks  or  i must return some hendle or similar  thanks

 
faustf:

hi i want create a library with some function that  create  a button and  other GUI , i have  a main program  call A  and library called  B    in  program A i call with include my libraryB.mqh, inside of them  i  want create  a function called 

but  before  GuictrlButton ()  what i must insert ??  and  will be correct  the function ? thanks  or  i must return some hendle or similar  thanks

"The preprocessor replaces the line #include <file_name> with the content of the file" - Including Files (#include)

Show your attempt. Then maybe you can get help. For now, your question is very vague.

Try first on a simple task to do what you want. For example, create .mqh file that contains one simple function. Then call this function from another file using #include. If you have trouble calling one simple function and you will show your attempt, then you will most likely get help here. The better you localize the problem, the more likely you are to be helped. Few people want to look for an error in a long code.

In the meantime, it looks like: "I don't understand what I'm doing. Tell me what I'm doing wrong"

 
faustf:
GuciCtrlButton(string SymbolBut, string NameBut ,string NameText, int xWdit, int yWdit, int xSize, int ySize)
{

Where is the type of return value?

double                       // return value type
linfunc (double a, double b) // function name and parameter list
  {
                             // composite operator
   return (a + b);           // return value
  }

Visit documentation (the code above is from it)