Download MetaTrader 5
To add comments, please log in or register
Do you have Mac OS? Find out how to install MetaTrader on it!
rDc
6
rDc 2015.12.02 00:11 

I just create a EA that contain a .DLL created by my self.

The EA work fine when I put it in one symbol (anyone), but when I try to run the EA in more that one symbol, it crash.

I made a copy of the EA without calling the DLL and everything work fine, so I'm assuming that the problem is when

each EA call the function from the same DLL


Can anyone please help me on that?

Thanks.

ThreadHandle
105
ThreadHandle 2015.12.03 05:43  
Running multiple EA's calling the same DLL? You've probably got one of two issues, the first is that they are both making the same call at the same time (unlikely), the probable is that the DLL will be associated to the first EA you run with that DLL. So the "DLL_PROCESS_ATTACH:" is your problem, i dont know a great deal about DLL (i failed using VS getting my DLL to work) but if you could have a thread that ran your DLL, then made a separate DLL that calls the thread when it has process attach then unlink the DLL and hopefully it should be linked to the thread.
BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
  {
//---
   switch(ul_reason_for_call)
     {
      case DLL_PROCESS_ATTACH:
         // A process is loading the DLL.
      case DLL_THREAD_ATTACH:
      case DLL_THREAD_DETACH:
      case DLL_PROCESS_DETACH:
         break;
     }
//---
   return(TRUE);
  }
ThreadHandle
105
ThreadHandle 2015.12.03 05:44  
How did you compile the DLL?
/
To add comments, please log in or register