How To Use Kernel32.dll's GetLastError()?

 
#import "kernel32.dll"
int GetLastError();

#import


This Function Name Matched With GetLastError() in the mql4 functions.


I want to know the "_lopen" 's error code in kernel32.dll


How to do that?

 
PrintFormat("Error Code: %d", kernel32::GetLastError());


Regards.

 
Jose Francisco Casado Fernandez:


Regards.

Thank You ^^

Fast Answer.

 
Shin Joo Young:

Thank You ^^

Fast Answer.

You are welcome. Regards.
 

 how to declare import to use it?


kernel32::GetLastError()


I'm using MQL5

 
alerin #:

 how to declare import to use it?



I'm using MQL5

Read the thread. It's the same for MQL5.

The import file name will be the namespace name of the functions. It is declared with "using", so you don't have to use the namespace, but for overlapping names, you can use it to distinguish between two functions with the same name.
Reason: