MQL5 CreateFileMappingW (#import "kernel32.dll") Invalid Handle ??

 
#import "kernel32.dll"
   int   CreateFileMappingW(int,int,int,int,int,const string);
   int   GetLastError();
#import

void OnStart()
{
    int hMapFile= CreateFileMappingW(-1,NULL,4,0,256,"Global\\test");

    Print("CreateFileMapping_error:",kernel32::GetLastError());
    Print("hMapFile=:", hMapFile);
}

Hi, can someone tell me why I get...

CreateFileMapping_error:6   (= Invalid Handle)
hMapFile=:0

Thanks!

 
ccou:

Hi, can someone tell me why I get...

Thanks!

MT5 is 64-bits application, a correct signature is :

   long  CreateFileMappingW(long,long,int,int,int,const string);

Also to write on "Global" namespace, you need the right to do so.

 
Merci Alain, you're a god!!!
Reason: