Windows System error Codes 0 - 16000 userlib

Share your advanced PureBasic knowledge/code with the community.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Windows System error Codes 0 - 16000 userlib

Post by ts-soft »

Many work, but what is the difference to:

Code: Select all

Procedure.s GetLastErrorStr(error.l = 0)
  If Not error
    error = GetLastError_()
  EndIf
  Protected Buffer.i, result.s
  If FormatMessage_(#FORMAT_MESSAGE_ALLOCATE_BUFFER|#FORMAT_MESSAGE_FROM_SYSTEM,0,error,0,@Buffer,0,0)
    result = PeekS(Buffer)
    LocalFree_(Buffer)
    ProcedureReturn result
  EndIf
EndProcedure
This comes in my locale language. :wink:

greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Windows System error Codes 0 - 16000 userlib

Post by IdeasVacuum »

The mind boggles - 16,000 potential errors :shock:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: Windows System error Codes 0 - 16000 userlib

Post by fsw »

16,000 errors?
Nowadays everything is so complicated.
I remember the good old times where you had only 2 states on Windows:
Either it worked or you got the BSOD.

:mrgreen:
Post Reply