how EA can open a file in dll - page 2 12 New comment Alain Verleyen 2013.09.15 09:25 #11 forex2start: You may use _wfopen function to open file with "wchar_t *" type filename.And this is my code: And it is a simple VC++ DLL project, no .def file required.Can you show the mql5 test code also ? Jian Chen 2013.09.15 09:34 #12 angevoyageur: Can you show the mql5 test code also ?Sure, the code is very simple.#import "TestDLL.dll" void TestFile(string filename); #import //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- TestFile("test.txt"); } //+------------------------------------------------------------------+ After running the above mql5 script program, a "test.txt" file will be generated at the installation folder of MT5.If we specify an absolute path, for example, "d:\\test.txt", the file will be created right there. Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties www.mql5.com Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties - Documentation on MQL5 Scripts: Instance ID script Testing 'CopyTicks' How to OPEN & ctycheer 2013.09.15 10:23 #13 forex2start: You may use _wfopen function to open file with "wchar_t *" type filename.And this is my code: And it is a simple VC++ DLL project, no .def file required.thank you very much!!!It's work!!!So the string in metatrader is UNICODE!!!!!!, if you use char in the dll ,the program couldn't work normallyIt‘s very interesting!!!!At the first time , I realize the value of Unicode.I met the trouble for two months ,but now it's not a problem .thank you ! mt4excel.dll issue What's all this nonsense Errors, bugs, questions 12 New comment
You may use _wfopen function to open file with "wchar_t *" type filename.
And this is my code:
And it is a simple VC++ DLL project, no .def file required.
Can you show the mql5 test code also ?
Sure, the code is very simple.
After running the above mql5 script program, a "test.txt" file will be generated at the installation folder of MT5.
If we specify an absolute path, for example, "d:\\test.txt", the file will be created right there.
You may use _wfopen function to open file with "wchar_t *" type filename.
And this is my code:
And it is a simple VC++ DLL project, no .def file required.
thank you very much!!!
It's work!!!
So the string in metatrader is UNICODE!!!!!!, if you use char in the dll ,the program couldn't work normally
It‘s very interesting!!!!
At the first time , I realize the value of Unicode.
I met the trouble for two months ,but now it's not a problem .thank you !