Mt4 Build 600 or Higher MinGw

 

Hi,

I using for development QtCreator and newwest MinGw. For Build 600 I didnt get any problem. After that build I got SEGFAULT when I try call any function.

I using def file;

Example:

extern "C"

{
int dll_test( MqlStr * str);
}

 int dll_test( MqlStr * str)
{
    info("test");
   return 0;
};

DllMain function is called. I got inforation when:
DLL_PROCESS_ATTACH
DLL_PROCESS_DETACH


Anybod Could help?

Big regards
 
Hi see here
 

I used this struct ( i found this art)


struct MqlStr

{
    int len;
    wchar_t* string;
    int dummy; // for padding
};

Also in my function I dont call any obejct.pointers/etc from parameters

So that is mabye call convention?

Maybe __stdcall ls not correct for new build?

MT4 Code:
#import "pocBuild600.dll"
int dll_test(string &s);
#import
Withoud any code (i try only logger/messagebox etc., print int to std,file,any action ) I got error of MT4 and terminated process.

Anybody have idea why?
 

If you want to pass just a string, try to use wchar_t* instead of MqlStr.

string argument (in MQL) is not needed defined as string& but string.

If you want to pass back the string from dll into the argument, allocate ushort[] variable in mql and pass it to dll, and receive it as wchar_t* in dll side.


Add: you had pasted the src code and manually highlighted it? try to use SRC button in the toolbar of this form!

Reason: