#include <somelibrary.mqh> doesn't work on Library Studio
-
Hi:
I'm using Library Studio to write own custom blocks.
When I try to #include some MQL4 standard library in "Global Variables, Includes" Area, the MQL4 code generated shows some errors.
For example, if I include:#include <Controls\Dialog.mqh>Then, the MQL4 code I can see is:
#include ArrayThere are any workaround o solution to this? I know Library Studio is being used only by 3 or 4 "mad men", like me.

-
Reuploaded under the same build number, so if there are problems - tell me.
I don't know how it will be on your side, but I got error messages somewhere in Chartobject.mqh file ("cannot convert enum"). If you have them also, add (ENUM_OBJECT_PROPERTY_STRING) before OBJPROP_TEXT so it will be like this:
//--- result return(ObjectGetString(m_chart_id,m_name,(ENUM_OBJECT_PROPERTY_STRING)OBJPROP_TEXT)); } -
__Reuploaded under the same build number[/quote:3rciz2pj]
I don't understand this one.
What do you mean?? To delete my custom block and rewrite it and then change the block number to the old one??__
I don't know how it will be on your side, but I got error messages somewhere in Chartobject.mqh file ("cannot convert enum").
[/quote:3rciz2pj]Yes, I have the same error. I try your solution.
-
Ahhhhh....ok, sorry. You have uploaded a new fxDreema build, with the same version number....it's true?
Ok, now I can include MQL4 Standard Library MQH files with no errors...but I've other problems:
Problem 1 - Global Variables like this:
```
CArrayString *arrayGraficos;whe I make a MQL4 file, this global variable is assigned to 0, like this:CArrayString *arrayGraficos = 0;
Problem 2 - And when I try to compile the program in Fxdreema, some errors are displayed: ...... [fxdreema_compiling_error.jpg](/forum/uploads/files/1398862003-2460-5985.jpg) -
I don't remember why I decided to add " = 0;" to global variables that does not have value, but I think now with the new MQL4 there will not be a problem for those variables to not have value.
Reuploaded again with this thing fixed.More details about the last error? Maybe some link to a file to be included does not exists?
Does MetaEditor reports the same errors? -
__I don't remember why I decided to add " = 0;" to global variables that does not have value, but I think now with the new MQL4 there will not be a problem for those variables to not have value.
Reuploaded again with this thing fixed.
[/quote:3peifwp5]Thanks!
__
More details about the last error? Maybe some link to a file to be included does not exists?
Does MetaEditor reports the same errors?[/quote:3peifwp5]In MetaEditor works fine. I test 2 EA and same errors are shown. I change to other computer and I think the error is about "Program Files/MetaTrader" or anything in that way.... This error is with new rebuilds uploaded, maybe.

......
error_fxdreema.jpg -
You used that "Program Files/MetaTrader" somewhere in the project? Give me some more details, what is on the picture is... I have no crystal ball
Some .mq4 file? -
Ok. MQL4 file attached.
......
PirateAlarm.mq4 -
The same errors are shown with a new fxdreema project with no blocks...

thanks.
-
Opps, wrong command to the compiler. How is it now?
-
Ok. With MetaEditor I can compile, so It's not a critical bug.
I have another error with fxdreema code generated. It's only when I #include a custom class that work with graphical components (Dialog.mqh, ComboBox.mqh, etc...). This is the error in the fxdreema code:
......
error_metaeditor.png -
Those warnings.... how is it now?
-
Attached 2 MQL4 Files, the last one, and the include file that i think it's doing fxdreema code errors.
Thanks.
......
PirateAlarm.mq4 -
mmmm the second file "MiVentana.mqh" isn't being uploaded....I try again with code marker:
//+------------------------------------------------------------------+ //| MiVentana.mqh | //| Copyright 2014, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2014, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" #property strict #include <Controls\Dialog.mqh> // #include <Controls\Panel.mqh> #include <Controls\ComboBox.mqh> #include <Controls\Label.mqh> #define X_START 0 #define Y_START 0 #define X_SIZE 280 #define Y_SIZE 300 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class MiVentana : public CAppDialog { private: CComboBox m_combo_box; //--- labels CLabel m_label; //--- current value of the array type from the combo box int m_combo_box_value; public: MiVentana(); ~MiVentana(); virtual bool Create(const long chart,const string name,const int subwin,const int x1,const int y1,const int x2,const int y2); //--- handler of chart events virtual bool OnEvent(const int id,const long &lparam,const double &dparam,const string &sparam); protected: //--- create labels // bool CreateLabel(CLabel &lbl,const string name,const int x,const int y,const string str,const int font_size,const int clr); virtual bool CreateComboBox(void); virtual void OnChangeComboBox(void); }; //+------------------------------------------------------------------+ //| Handling events | //+------------------------------------------------------------------+ EVENT_MAP_BEGIN(MiVentana) /* ON_EVENT(ON_CLICK,m_button_add,OnClickButtonAdd) ON_EVENT(ON_CLICK,m_button_free,OnClickButtonFree) */ ON_EVENT(ON_CHANGE,m_combo_box,OnChangeComboBox) EVENT_MAP_END(CAppDialog) //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ MiVentana::MiVentana() { } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ MiVentana::~MiVentana() { } //+------------------------------------------------------------------+ bool MiVentana::Create(const long chart,const string name,const int subwin,const int x1,const int y1,const int x2,const int y2) { //--- calling the method of the parent class if(!CAppDialog::Create(chart,name,subwin,x1,y1,x2,y2)) return(false); //--- create labels // if(!CreateLabel(m_label,"Estrategias",X_START+10,Y_START+5,str_physical,12,clrBlack)) // return(false); //--- create control elements if(!CreateComboBox()) return(false); //--- success return(true); } //+------------------------------------------------------------------+ //| Create a combo box | //+------------------------------------------------------------------+ bool MiVentana::CreateComboBox(void) { //--- create the combo box if(!m_combo_box.Create(m_chart_id,"type_combobox",m_subwin,X_START+100,Y_START+110,X_START+200,Y_START+230)) { Alert("problema creando el combo"); Alert(IntegerToString(GetLastError())); return(false); } //--- add elements to the combo box if(!m_combo_box.ItemAdd("PiratePips",0)) { Alert("problema creando el primer item del combo"); return(false); } if(!m_combo_box.ItemAdd("PiratePips with ATR Projectios",1)) { Alert("problema creando el segundo item del combo"); return(false); } //--- store the current combo box element m_combo_box_value=0; //--- add the combo box to control elements if(!Add(m_combo_box)) { Alert("problema aรฑadiendo el combo a la ventana"); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Handler of the combo box change event | //+------------------------------------------------------------------+ void MiVentana::OnChangeComboBox(void) { //--- check if the array's type has changed if(m_combo_box.Value()!=m_combo_box_value) { //--- work with another array type m_combo_box_value=(int)m_combo_box.Value(); } } -
Hi:
I think that "undeclared identifier" MetaEditor error can be solved rewriting variables "tt, ask, bid" declaration, like this:

Putting the variables declaration out of the IF code block:

I don't know if you can get side effects in this change....
, but no compiler errors are shown. -
I think I fixed it already
How is it now? -
I don't know...

Other problem with #includes....if I have 2 Fxdreema blocks importing MQL4 Standard Library files in the fxdreema "Global Variables, Includes" area, only one MQH file is imported in Fxdreema generated code...
Fxdreema Block 1 (block put in OnTick fxdreema area):
#include <Arrays\ArrayString.mqh>Fxdreema Block 2 (block put in OnInit fxdreema area):
#include <Controls\Dialog.mqh>Only the second one is included on fxdreema MQL4 generated code.
-
Now it must be ok
