|
|
Register
|
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
|
|
Exclusive Forum
|
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
- Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
- Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more
|
 |
|
|

11-20-2005, 01:18 AM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
MT4 Files Functions Replacement.
Hi folks,
A lot of people asked me and metaquotes forum about file handling functions.
I think MT4 have a lot of bugs in those functions.
1- They don't work in backtesting
2- They don't write outside "MetaTrader 4\experts\files" path.
Today I opened my Visual C++ and wrote a file handling dll for MT4, I hope you enjoy it, and its source code, and tell me your  .
Setup:
1- Extract the " mtguru1.dll" to "MetaTrader 4\experts\libraries" path.
2- Extract " FilesDemo.mq4" to "MetaTrader 4\experts\indicators" path and compile it.
3- Extract " gFiles.mqh" to "MetaTrader 4\experts\include".
4- Load FilesDemo from your Indicators - don't forget to enbable "Allow DLL Import"
5- Enjoy.
Last edited by codersguru; 11-25-2005 at 01:26 PM.
Reason: gFiles.mqh
|

11-21-2005, 12:22 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
Feedback
Hi folks,
Any feedback please   ?
|

11-21-2005, 01:39 PM
|
|
Junior Member
|
|
Join Date: Oct 2005
Posts: 12
|
|
|
Well, I haven't tested it. But if it works..that is AWESOME!!
I checked out the demo .mq4 file, and it is so simple and elegant. Good work.
The only issue I have is what to do about new lines.
How do I use gFile to write a new line?
Last edited by fivewhy; 11-21-2005 at 01:58 PM.
|

11-21-2005, 02:09 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
Thank!
Quote:
|
Originally Posted by fivewhy
Well, I haven't tested it. But if it works..that is AWESOME!!
I checked out the demo .mq4 file, and it is so simple and elegant. Good work.
The only issue I have is what to do about new lines.
How do I use gFile to write a new line?
|
fivewhy,
Thank you very much for your comment. 
I think the new line printing issue needs some work from me, Thanks for the notice.
|

11-21-2005, 08:48 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 208
|
|
well done  , but file functions (as well as many other) may be used directly from windows API dlls.
example of file copy function import:
#import "Kernel32.dll"
bool CopyFileA (string source_file, string destination_file, bool if_exist);
with DLLs you can do a lot of things, like SQL database access and so on.
|

11-21-2005, 08:58 PM
|
|
Junior Member
|
|
Join Date: Oct 2005
Posts: 12
|
|
|
where can I find a list of all functions available in kernel32.dll (and other windows .dll's)?
Edit: Found it. See attched.
Last edited by fivewhy; 11-21-2005 at 09:21 PM.
|

11-21-2005, 10:27 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
That's right, but?
Quote:
|
Originally Posted by Beluck
well done  , but file functions (as well as many other) may be used directly from windows API dlls.
example of file copy function import:
#import "Kernel32.dll"
bool CopyFileA (string source_file, string destination_file, bool if_exist);
with DLLs you can do a lot of things, like SQL database access and so on.
|
Beluck,
That's right  , but could you give me .mql demo shows me how to use the kernel32 functions CreateFile, OpenFile, WriteFile and ReadFile in MQL4
Code:
HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile
);
HFILE OpenFile(
LPCSTR lpFileName,
LPOFSTRUCT lpReOpenBuff,
UINT uStyle
);
BOOL WriteFile(
HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped
);
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
|

11-25-2005, 10:21 AM
|
|
Junior Member
|
|
Join Date: Nov 2005
Posts: 6
|
|
|
ted
alerts.mqh not part of mtguru1.zip, could not run FilesDemo? Thanking you in advance.
|

11-25-2005, 01:25 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
|
gFiles.mqh
Quote:
|
Originally Posted by sx ted
alerts.mqh not part of mtguru1.zip, could not run FilesDemo? Thanking you in advance.
|
sx ted,
I'm sorry, I meant " gFiles.mqh"
To run FilesDemo:
1- Extract the " mtguru1.dll" to " MetaTrader 4\experts\libraries" path.
2- Extract " FilesDemo.mq4" to " MetaTrader 4\experts\indicators" path and compile it.
3- Extract " gFiles.mqh" to " MetaTrader 4\experts\include".
4- Load FilesDemo from your Indicators - don't forget to enbable " Allow DLL Import"
|

11-25-2005, 03:07 PM
|
|
Junior Member
|
|
Join Date: Nov 2005
Posts: 6
|
|
|
ted
CodersGuru, thank u super, have u got equivalent of FileTell()
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 04:04 AM.
|