Since I'm new, this can be a very simple question. I run DirectX 11, and when creating my first application, wWinMain was used, and looking for the difference between WinMain and wWinMain, I came across this prevInstance parameter.
prevInstance is always null according to MSDN, and since it is always null why it exists (since it is logical to think that the creators did not provide a useless parameter). And (quoting from the book),
if you need a way to determine if the previous instance of the application was already running, the documentation recommends creating a unique mutex using CreateMutex. Although there will be a mutex, the CreateMutex function will return ERROR_ALREADY_EXISTS.
What is a mutex and how to use it (a good enough link). And it seems like a method is needed to find if another instance of the application exists, prevInstance should have a pointer or a reference to it, which, apparently, is not the case, since it is null. Why is this and what is the role of prevInstance?
Speedbirdnine
source share