I wonder if anyone who visits know how C++ handles it........
See above for C and C++.
What's even odder is this:
uint ExampleTickCount = 0xE63E21EB;
int test_int = ExampleTickCount;
test_int++; // Affects the subsequent cast
long test_long = (long)test_int;
MessageBox("int: " + test_int + "\r\nlong: " + test_long);
If you do any manipulation of the int, such as test_int++, then it ceases to have the "memory" of the uint.
I think it's almost certain that the difference is an unintentional artifact of the compiler's optimization. If you do a cast, and then another cast of the unmodified value, then the compiler in effect optimizes to doing a cast from the original value. IMHO that's a very, very obscure and very, very unimportant bug.
https://www.mql5.com/en/forum/148851/page15#898140 may mean that this will be changed back before launch so that old EAs use the old RateInfo structure.
If not, or if you want to recompile your EAs with the new version of MT4, then you need to change your DLL (or add a second version of each function0.
Thanks a lot.
I used to link DLLs with VC++ 2008.
Notice that the length of long type in VC++ is 4 byte but in Mql+ is 8 byte.
So I modify the declaration of struct RateInfo in CPP like below:
long long ctm;
long long tick_vol;
long long real_vol;
Now the DLLs receive the correct OHLC so that old EAs can work well.
If any one is still interested with weird behaviour... this time it is about indicators.
All tickets in work.
#937128 seems to be fixed in build 578.
#933683 and #927090 are not fixed.
And we are here also have no idea what are those either.
Mind sharing what are those ?
See above. They were discussed on page 15 onwards.
#933683 is a recommendation that old EAs continue to use experts\files in FileOpen(), instead of MQL4\Files. #927090 is a recommendation that old EAs continue to use the old RateInfo structure when passing price data to DLLs.
Both will cause major transition problems for thousands of users with old EAs if not implemented. Both are no different in principle to old EAs continuing to use Ansi strings in DLL calls. If preserving backward compatibility by keeping Ansi strings, why not keep other aspects of backward compatibility by continuing to use the same file locations and data structures?