Passing strings from DLL to MQL5

 

Hi, 

   I have developed a DLL in VS 2010 ( Uses Unicode Character Set ) and am trying to pass string (wchar_t*) from the DLL  function as return value but have failed in every attempt. Need help to get this issue resolved. 

e.g DLLAPI wchar_t* __stdcall cMySqlVersion() 

 

Hi,

Try this:

extern "C" __declspec(dllexport) wchar_t* cMySqlVersion()
 
forex_trader:

Hi,

Try this:

tried that already but still unsuccessful.
 
268615:
tried that already but still unsuccessful.

Here is the function

extern "C" __declspec(dllexport) wchar_t* __stdcall cMySqlVersion()

{

 return ("MQLMySQL v2.0");

 

A small correction:

extern "C" __declspec(dllexport) wchar_t* __stdcall cMySqlVersion()

{

 return (L"MQLMySQL v2.0");

}