stange errors of standard function (WindowHandle()) and -values ERR_FILE_READ_ERROR => not defined ???
gooly:
BUT WindoweHandle(..) should be a valid mql4-function (from the Reference):
And the editor does NOT highlight the function as a genuine mql4-function.
BTW which one is correct - or better?
#include <file_name> #include "file_name"
- They are both corrent and neither is better. The <angle> version means the file must be in the MQL4/includes directory, the "quote" version means the file is in the same directory as the includer. This is what Including Files (#include) - MQL4 Documentation says.
- My code compiles and works. When both your code and mine was written, there was no MQL4 WindowHandle. Thus the WinUser32 was required.
#include <WinUser32.mqh> #import "user32.dll" int GetAncestor(int, int); #import void PauseTest(){ datetime now = TimeCurrent(); static datetime oncePerTick; if(oncePerTick != now)if( IsTesting() )if( IsVisualMode() )if( IsDllsAllowed() ){ oncePerTick = now; #define GA_ROOT 2 for(int i=0; i<200000; i++){ // Delay required for speed=32 (max) if(IsStopped()) break; // https://forum.mql4.com/32837 WH-DL int main = GetAncestor(WindowHandle(_Symbol, _Period), GA_ROOT); if(i==0) PostMessageA(main, WM_COMMAND, 0x57a, 0); // 1402. Pause // TBD replace loop/postmessage with sendmessage } } //{The PostMessage above sends the command to the main terminal. Thus it // only affects the active chart window. To maximize a window for example // must activate it first. https://forum.mql4.com/35336#538848 //}See also SetForgroundWindow(h) https://www.mql5.com/en/code/mt4 }
PrintFormat("ih=%i, re=%i", ERR_FILE_INVALID_HANDLE, ERR_FILE_READ_ERROR); // 2015.08.16 14:25:22.282 testscr EURUSD,H1: ih=5007, re=5015
Compiles fine for me.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
as I (Win7, 64, Term. 840, Editor 1154) wanted to compile some of my old mqh I get some new previously not known Errors:
=> 'WindowHandle' - function not defined Win32FuncsAll.mqh 846 27
This is the function:
BUT WindoweHandle(..) should be a valid mql4-function (from the Reference):
And the editor does NOT highlight the function as a genuine mql4-function.
?????
Beside that I get some more of those compiler errors:
'ERR_FILE_INVALID_HANDLE' - undeclared identifier Win32FuncsAll.mqh 893 17
'ERR_FILE_READ_ERROR' - undeclared identifier Win32FuncsAll.mqh 908 17
And even here these are mq4 predefined Error-code:
Anybody else with errors like this?
BTW which one is correct - or better?
If I use in an mqh-file the <>-version and try to compile it I get:
But the \MQL5\.. does not exists - of course I am using MQL4,
but this
works it seems to to pretend to request MQL5.
PS: It would be so easy to check the path of the mqh-file to be compiled and to use for compilation the mq4-version in case one detects \MQL4\ and the mq5-version otherwise !!