Data exchange between two MT4 terminals? - page 3

 
granit77:
goldtrader: Isn't it a conflict situation when one EA opens a file for writing and while the file is still open, another EA opens (or tries to open) the same file for reading?
I, as a person confident in the power of science, find the situation a bit dramatic. You can read as much as ten people, but to write can use checks, prohibit flags, etc. It's a purely technical issue and not an obstacle. This is a purely technical issue and is not an obstacle, files from anywhere have long been read and written using API. Interesting are other ways to transfer information between terminals, which have not been used before. For example, to transfer information in the form of a Windows environment variable.
I agree. I also would like to make data transmission without file, it's faster and more reliable. But I don't think anyone has anything to say about it yet, that's why everyone is fixated on transferring through a file((((
 
goldtrader:
gravity001:

There is no problem because one EA keeps writing to the file and the other EA keeps reading from the file and it doesn't matter in what order it happens. To check data relevance I used local time, i.e. quotes are written every 100 milliseconds and then they are checked for relevance by local time.


Isn't it a conflict situation, when one EA opens a file for writing and while it is still open, another EA opens (or tries to open) the same file for reading?
No, it is not a conflict, because you can read a file at any time, even if it is open for writing. But if the same file is open for writing twice at the same time, then there will be a conflict.
 
zhuki:

For information, if you click on terminal.exe 4 times, two copies of the same terminal will open, and the paths must be the same.

I tried clicking, it didn't work. Are you sure it works?
 
gravity001:

I also would like to do data transfer without file, it's faster and more reliable. But I think so far no one has anything to say about it, that's why all are stuck in transferring through a file(((

Is it possible to reserve memory space with the right to access it for 2 applications?

It's kind of a clear conflict too, with provoking errors of this kind:




0009 0x0009 Invalid memory management address

0998 0x03E6 Invalid memory address access attempt

One of the applications will try to access a memory address to which it does not have access rights


 
D500_Rised:
The problem is this: the problem is not solved in the first place:

I want to pass data without file too, it's faster and more reliable. But I don't think anyone has anything to say about it yet, that's why everyone is fixated on transferring through a file((((

Is it possible to reserve memory space with the right to access it for 2 applications?

It's kind of a clear conflict too, with provoking errors of this kind:




0009 0x0009 Invalid memory management address

0998 0x03E6 Invalid memory address access attempt

One of the applications will try to access a memory address to which it does not have access rights


Maybe you can't, I don't know for sure. Here, in this thread https://forum.mql4.com/ru/3393 they wrote about GlobalAddAtom. If I've understood correctly, it will be possible to pass the variable without the file, i.e. through memory. But I don't know how to do it(((


You also gave an example, can you tell me how you tried to do it?

 

Oh, a thought popped into my head again - the Windows clipboard is read-write accessible by applications without any memory address restrictions!

Буфер обмена (clipboard)- набор функций и сообщений, который делает возможным передачу данных в прикладные программы, разработанные при помощи Microsoft ® Win32 ® прикладного программного интерфейса (API). Поскольку все прикладные программы имеют доступ к буферу обмена, данные могут быть легко перемещаемы между приложениями или внутри прикладной программы.

But here's another small stick in the wheel:

The clipboard is user-controlled. The window must only transfer data to or from the clipboard in response to a command from the user. The window must not use the clipboard to transfer data without notifying the user.

So, only the API :^(

 
D500_Rised:

Oh, a thought popped into my head again. The Windows clipboard is read-write accessible by applications without any memory address restrictions!

Aclipboard is a set of functions and messages that makes it possible to transfer data to application programs designed using the Microsoft® Win32® application programming interface( API). Because all application programs have access to the clipboard, data can easily be moved around between applications or within an application program.

But here's another small stick in the wheel:

The clipboard is user-driven. The window should only transfer data to or from the clipboard in response to a command from the user. The window should not use the clipboard to transfer data without notifying the user.

So, only the API :^(

Seems clear, but how to implement it, can you be more specific?
 

Either learn the Win 32 API yourself, or look for a coder who will take the job. There is not much choice here.

But in my opinion, this system is not worth the cost.

 
gravity001:
zhuki:

Just for the record, if you click on terminal.exe 4 times, two copies of the same terminal will open, and the paths should be the same.

I tried clicking, it didn't work. Are you sure it's working for you?
I tried again, two copies of the same terminal are opening. I didn't come up with this myself, it's a known fact for a long time.
 
Here is the discussion https://forum.mql4.com/ru/9244#49606