Download MetaTrader 5

C+ coding question for library.dll

To add comments, please log in or register
Move from theory to practice. Code Base will help you!
Funky
125
Funky 2011.11.13 02:34 
bool LibrarySecurityQ1(){return(false);}

int AccountsAllowed(){return(AccountNumber());}

Hi, I am trying to write a .dll for my EA.

I am new at C++ though, and I am trying to convert the above MQL into C++.  If someone could show me an example of the above in C++ I would be very grateful.

If anyone is really brave, I would be curious how to convert the below in to C++ too (this expiry idea was compliments of Sergey Kravchuk's protection article)


int Expiry()
{  
  string char[256]; int i;
  for (i = 0; i < 256; i++) char[i] = CharToStr(i);
  // Date, until which the expert is allowed to work
  int LastAllowedDate = StrToTime(
  // 2011.12.12 23:59:00  
  char[50]+char[48]+char[49]+char[49]+char[46]+char[49]+char[50]+char[46]+char[49]+
  char[50]+char[32]+char[50]+char[51]+char[58]+char[53]+char[57]+char[58]+char[48]+char[48]
  ); 
  if (TimeCurrent() >= LastAllowedDate) 
  {
  return(444);
  }
  return(555);
}

I am currently using a library.ex4 as security, however would like to step it up a notch into a .dll

Any help would be appreciated.

Thank you kindly.

To add comments, please log in or register