Write into DLL

 

I have write into dll

my dll code is :

_DLLAPI void    __stdcall minus( double aaa ,char* g)
  {
    std::ofstream fs(g); 
    fs<<aaa;
    fs.close();
 
  }
 

and my mql5 code is :

#import "MQL5DLLSamples.dll"
void minus(double aaa,string g);
#import
void OnStart()
  {
 minus(96,"C:\\m\\j.txt");
  }
//+------------------------------------------------------------------+

 
why dont work ?

 
baza12:

I have write into dll

my dll code is :

and my mql5 code is :

 
why dont work ?

Please read this article : How to Exchange Data: A DLL for MQL5 in 10 Minutes - MQL5 Articles

The issue is certainly with string versus char. Feel free to ask if it doesn't help you. You can then post error message you got.

 
Yes that is the question .last version of MT4 was, now apdayta can pick up how to replace char * in c ++ in string in mql5
 
baza12:
Yes that is the question .last version of MT4 was, now apdayta can pick up how to replace char * in c ++ in string in mql5
Sorry I don't understand your post ?
 

this code run in mql4.

in mql5 dont run.

why i replace char* to string

Reason: