I'm normally a POSIX programmer but I'm using the Windows API for this project, which is the first time that I've ever used it.
I'm kind of confused about what's the correct and/or best way to handle errors. I'm sorry if this is a newbie question but I'm unable to find a straight answer.
From MSDN's page on the WinMain() function;
In the POSIX world, when a program runs into a fatal error (out of memory, or it is unable open a necessary file, being a couple of examples), it would return a non-zero error code back to the operating system.Return Value
If the function succeeds, terminating when it receives a WM_QUIT message, it should return the exit value contained in that message's wParam parameter. If the function terminates before entering the message loop, it should return zero.
According to the above, I should return zero. I've look at many examples/tutorials that do the same. The documentation for WM_QUIT and PostQuitMessage() also don't mention what to return on error. Does anyone know what the correct procedure is for this?