MT4 Files Functions Replacement. - page 4

 
tworkman:
Also, I'm not an expert, but from the little I've learned about winsock, the listening functions are blocking functions, which means (I think) that the application (mt4) needs to be multi threaded. It would have to switch back and forth between listening for an incoming message, and doing its own work. for what its worth...

mt4 is already multi threaded. Every chart has its own thread. In order to use blocking winsock functions, one would like to attach a script to a chart with a continous loop. The script can then set/unset some global variables, which on the other hand can be used by any EA.

 
 

MT4 into SQL server - how to transfer data?

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.

Getting MT4 traderecords and quotes into a SQL database would be great.

But I don't know how to get this working.

Could someone explain step by step with code samples how to auto transfer these data into SQL server?

 

codersguru,

Do you still think these socket-based functions are a good idea? I'd like to hear if you've looked into it at all? Please let me know if you've had no time, or just given up on the idea.

Thanks.

 
tworkman:
codersguru,

Do you still think these socket-based functions are a good idea? I'd like to hear if you've looked into it at all? Please let me know if you've had no time, or just given up on the idea.

Thanks.

tworkman,

My problem is the time, I didn't give up the idea.

I'll inform you with the update as soon I get the time.

 

Hi again,

I've been working with a friend to write a dll in c++ that does this netcomm stuff, but I can't get past the problem mentioned above: cannot call function functionname from dll ' dllname.dll'

If and when your time permits, would you be willing to take a look at the source and let me know if you can see what is wrong? We've actually tried compiling with two different c++ compilers, and still get the same error. We even took the sample source code that mt4 delivers, and get the same error when trying to call those functions. Seems like it must be a compile issue.

Please let me know.

Thanks.

 
tworkman:
Hi again,

I've been working with a friend to write a dll in c++ that does this netcomm stuff, but I can't get past the problem mentioned above: cannot call function functionname from dll ' dllname.dll'

If and when your time permits, would you be willing to take a look at the source and let me know if you can see what is wrong? We've actually tried compiling with two different c++ compilers, and still get the same error. We even took the sample source code that mt4 delivers, and get the same error when trying to call those functions. Seems like it must be a compile issue.

Please let me know.

Thanks.

tworkman,

Did you try the source code of my dll? it's wrote in VC++.

Please try to compile my source code and tell me what you get.

 
tworkman:
We even took the sample source code that mt4 delivers, and get the same error when trying to call those functions. Seems like it must be a compile issue.

Please let me know.

Thanks.

This is not good. I have no problems with compiling it. Maybe too simple, but have you enabled calling DLL functions from MT4?

 
michal:
This is not good. I have no problems with compiling it. Maybe too simple, but have you enabled calling DLL functions from MT4?

Sure, you have to enable "Allow DLL Import"

 

Yes, I do have the Allow DLL Imports box checked.

When I try to open your code's dsw file, I get a warning that the project must be converted to the current VC++ format. I am using the .Net version. Could this be the problem? I know very little about C++, so I haven't tried going any further. The friend that was helping me has been unavailable lately.