fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    #include <somelibrary.mqh> doesn't work on Library Studio

    Bug Reports
    2
    18
    4311
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kketzal last edited by

      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&#46;mqh>
      
      

      Then, the MQL4 code I can see is:

      
      #include Array
      
      

      There are any workaround o solution to this? I know Library Studio is being used only by 3 or 4 "mad men", like me. ๐Ÿ˜

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        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));
          }
        
        1 Reply Last reply Reply Quote 0
        • K
          kketzal last edited by

          __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.

          1 Reply Last reply Reply Quote 0
          • K
            kketzal last edited by

            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)
            
            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              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?

              1 Reply Last reply Reply Quote 0
              • K
                kketzal last edited by

                __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

                1 Reply Last reply Reply Quote 0
                • fxDreema
                  fxDreema last edited by

                  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?

                  1 Reply Last reply Reply Quote 0
                  • K
                    kketzal last edited by

                    Ok. MQL4 file attached.

                    ......
                    PirateAlarm.mq4

                    1 Reply Last reply Reply Quote 0
                    • K
                      kketzal last edited by

                      The same errors are shown with a new fxdreema project with no blocks... ๐Ÿ˜ฎ

                      thanks.

                      1 Reply Last reply Reply Quote 0
                      • fxDreema
                        fxDreema last edited by

                        Opps, wrong command to the compiler. How is it now?

                        1 Reply Last reply Reply Quote 0
                        • K
                          kketzal last edited by

                          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

                          1 Reply Last reply Reply Quote 0
                          • fxDreema
                            fxDreema last edited by

                            Those warnings.... how is it now?

                            1 Reply Last reply Reply Quote 0
                            • K
                              kketzal last edited by

                              Attached 2 MQL4 Files, the last one, and the include file that i think it's doing fxdreema code errors.

                              Thanks.

                              ......
                              PirateAlarm.mq4

                              1 Reply Last reply Reply Quote 0
                              • K
                                kketzal last edited by

                                mmmm the second file "MiVentana.mqh" isn't being uploaded....I try again with code marker:

                                
                                //+------------------------------------------------------------------+
                                //|                                                    MiVentana&#46;mqh |
                                //|                        Copyright 2014, MetaQuotes Software Corp&#46; |
                                //|                                              http://www&#46;mql5&#46;com |
                                //+------------------------------------------------------------------+
                                #property copyright "Copyright 2014, MetaQuotes Software Corp&#46;"
                                #property link      "http&#58;//www&#46;mql5&#46;com"
                                #property version   "1&#46;00"
                                #property strict
                                
                                #include <Controls\Dialog&#46;mqh>
                                // #include <Controls\Panel&#46;mqh>
                                #include <Controls\ComboBox&#46;mqh>
                                #include <Controls\Label&#46;mqh>
                                
                                #define X_START 0
                                #define Y_START 0
                                #define X_SIZE 280
                                #define Y_SIZE 300
                                
                                //+------------------------------------------------------------------+
                                //|                                                                  |
                                //+------------------------------------------------------------------+
                                class MiVentana &#58; public CAppDialog
                                  {
                                private&#58;
                                
                                   CComboBox         m_combo_box;
                                     //--- labels
                                   CLabel            m_label;
                                   
                                   //--- current value of the array type from the combo box
                                   int               m_combo_box_value;
                                  
                                public&#58;
                                   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&#58;
                                   //--- 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&#58;&#58;MiVentana()
                                  {
                                  }
                                //+------------------------------------------------------------------+
                                //|                                                                  |
                                //+------------------------------------------------------------------+
                                MiVentana&#58;&#58;~MiVentana()
                                  {
                                  }
                                //+------------------------------------------------------------------+
                                bool MiVentana&#58;&#58;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&#58;&#58;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&#58;&#58;CreateComboBox(void)
                                  {
                                //--- create the combo box
                                  if(!m_combo_box&#46;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&#46;ItemAdd("PiratePips",0))
                                   {
                                    Alert("problema creando el primer item del combo");
                                    return(false);
                                    }
                                      
                                   if(!m_combo_box&#46;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&#58;&#58;OnChangeComboBox(void)
                                  {
                                //--- check if the array's type has changed
                                   if(m_combo_box&#46;Value()!=m_combo_box_value)
                                     {      
                                      //--- work with another array type
                                      m_combo_box_value=(int)m_combo_box&#46;Value(); 
                                      
                                     }
                                     
                                  }
                                
                                
                                1 Reply Last reply Reply Quote 0
                                • K
                                  kketzal last edited by

                                  Hi:

                                  I think that "undeclared identifier" MetaEditor error can be solved rewriting variables "tt, ask, bid" declaration, like this:

                                  error_metaeditor.jpg

                                  Putting the variables declaration out of the IF code block:

                                  error_metaeditor2.jpg

                                  I don't know if you can get side effects in this change.... ๐Ÿ˜, but no compiler errors are shown.

                                  ......
                                  error_metaeditor.jpg
                                  error_metaeditor2.jpg

                                  1 Reply Last reply Reply Quote 0
                                  • fxDreema
                                    fxDreema last edited by

                                    I think I fixed it already ๐Ÿ™‚ How is it now?

                                    1 Reply Last reply Reply Quote 0
                                    • K
                                      kketzal last edited by

                                      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&#46;mqh>
                                      
                                      

                                      Fxdreema Block 2 (block put in OnInit fxdreema area):

                                      
                                      #include <Controls\Dialog&#46;mqh>
                                      
                                      

                                      Only the second one is included on fxdreema MQL4 generated code.

                                      1 Reply Last reply Reply Quote 0
                                      • fxDreema
                                        fxDreema last edited by

                                        Now it must be ok ๐Ÿ˜•

                                        1 Reply Last reply Reply Quote 0
                                        • 1 / 1
                                        • First post
                                          Last post

                                        Online Users

                                        M
                                        J
                                        5
                                        C
                                        E
                                        S
                                        T
                                        F
                                        F

                                        14
                                        Online

                                        146.7k
                                        Users

                                        22.4k
                                        Topics

                                        122.6k
                                        Posts

                                        Powered by NodeBB Forums | Contributors