SymbolInfo.mqh causes errors when included

To add comments, please log in or register
Jonathan Stearns
45
Jonathan Stearns  

When I include symbolInfo.mqh, it causes errors (attached).  Most of the errors says, "const modifier not allowed for nonmember functions". 

So far, I have the below:

#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\AccountInfo.mqh>
CPositionInfo  m_position;                   // trade position object
CTrade         m_trade;                      // trading object
CSymbolInfo    m_symbol;                     // symbol info object

 How do I make it a member?  Thanks.

Files:
Icham Aidibe
11613
Icham Aidibe  
Jonathan Stearns:

When I include symbolInfo.mqh, it causes errors (attached).  Most of the errors says, "const modifier not allowed for nonmember functions". 

So far, I have the below:

 How do I make it a member?  Thanks.

That code is right. It should compile right too. Can you show more ? 

Jonathan Stearns
45
Jonathan Stearns  
Icham Aidibe:

That code is right. It should compile right too. Can you show more ? 

Does this help?

Icham Aidibe
11613
Icham Aidibe  
Jonathan Stearns:

Does this help?

This is what you sent : 

#include <WinUser32.mqh>
#include <mq4.mqh>
//#include <Trade/Trade.mqh>
//#include <Trade/SymbolInfo.mqh>
//#include <Trade/PositionInfo.mqh>
//#include <Trade/AccountInfo.mqh>
//CPositionInfo  m_position;                   // trade position object
//CTrade         m_trade;                      // trading object
//CSymbolInfo    m_symbol;                     // symbol info object

#import "wininet.dll"
   int InternetAttemptConnect(int a0);
   int InternetOpenW(string a0, int a1, string a2, string a3, int a4);
   int InternetOpenUrlW(int a0, string a1, string a2, int a3, int a4, int a5);
   int InternetReadFile(int a0, int& a1[], int a2, int& a3[]);
   int InternetCloseHandle(int a0);

#import "kernel32.dll"
   void GetLocalTime(int& a0[]);
   int  GetTimeZoneInformation(int& a0[]);
#import

This is what you asked if it works and it did : 

#include <Trade/Trade.mqh>
#include <Trade/SymbolInfo.mqh>
#include <Trade/PositionInfo.mqh>
#include <Trade/AccountInfo.mqh>
CPositionInfo  m_position;                   // trade position object
CTrade         m_trade;                      // trading object
CSymbolInfo    m_symbol;                     // symbol info object

I suggest you to watch in <mq4.mqh> what's happening.

Jonathan Stearns
45
Jonathan Stearns  
Icham Aidibe:

This is what you sent : 

This is what you asked if it works and it did : 

I suggest you to watch in <mq4.mqh> what's happening.

Thanks for the guidance!  I will do that.  

Jonathan Stearns
45
Jonathan Stearns  
Jonathan Stearns:

Thanks for the guidance!  I will do that.  

Icham,

That worked.  There were things in mt4.mqh that was declaring the same as symbolinfo.mqh.  Thank you for your help!

Icham Aidibe
11613
Icham Aidibe  
Jonathan Stearns:

Icham,

That worked.  There were things in mt4.mqh that was declaring the same as symbolinfo.mqh.  Thank you for your help!

u welcome jon

To add comments, please log in or register