I'm going to show the lasterror both on the terminal using the Print function and export it to the file.
First I used GetLastError() on the Print function and then again use it on the procedure of exporting it on the file when I found out that the GetLastError return zero on my file and as I read the documentation I found out the _LastError reset after first using of GetLastError().
Now I'm considering the use of _LastError instead of GetLastError() on both Print function and exporting the error code on the file. Is there any deficiency on using the _LastError compared to GetLastError() ?
I know there is another solution such as setting a variable equal to GetLastError() and then use that variable anywhere else I want, But my main issue is about the differences between _lastError and GetLastError().
Thanking in advance for your kind guidance,