namespace anydll { #import "anydll.dll" int test(int x); #import } anydll::test(1);
it says: "#import" ... name expected
Really? When you click on "namespace" in the documentation about the new release, the link is a dead-end link. https://www.metatrader5.com/en/docs/basis/namespace
... is not working anymore and produces error "'anydll' is not a class, struct or union"
I cannot find nothing within the documentation about it.
it says: "#import" ... name expected
Really? When you click on "namespace" in the documentation about the new release, the link is a dead-end link. https://www.metatrader5.com/en/docs/basis/namespace
- www.mql5.com
Nope, it compiles not. When I got back to the build before, the same code compiles without any errors.
It compiles !
#import "anydll.dll" int test(int x); #import //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- anydll::test(1); }
After moving all code which imports Windows DLL functions into one file, the error message was gone - without changing any part of the code itself.
So this seems to be a kind of a preprocessor bug.
What I suspected was, that multiple imports of the the same DLL would cause this error, but after moving them to one file, I figured out that there were no multiple imports before, so I have no clue how I could provoke this error.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
... is not working anymore and produces error "'anydll' is not a class, struct or union"
I cannot find nothing within the documentation about it.