Calling DLL Exports function in MT5

 

Hello,


I am trying to create a DLL which exports certain functions that can be imported and called in MT5. However, I have a problem.

Let's take the following as an example.


extern "C" __declspec(dllexport) char * PrintMessage();
#import "Sample.dll"
string PrintMessage();
#import

Is this the correct way to use char * in MT5? I tried it and it printed gibberish characters.

Please advice! Thanks!

 

See String Type:

The string type is used for storing text strings. A text string is a sequence of characters in the Unicode format with the final zero at the end of it.