Error code 0x57 does not have anything to do with files. It is ERROR_INVALID_PARAMETER.
Looking at your code, you have only filled in four of the ten members of WNDCLASS. Fill in the rest as well, and you should be fine.
سؤال
At the moment I am simply trying to create a blank window as part of a DLL that provides behind the scenes communication with our platform. No other part of this DLL will ever display anything.
Currently I instantiate the window class as such:
WNDCLASS wc;
wc.cbClsExtra = 0;
wc.style = 0;
wc.hInstance = hInstance;
wc.lpszClassName = "Preview";
I then register the class:
if((RegisterClass(&wc)) == 0)
{
DWORD dwErrorNum = GetLastError();
**some logging function here**
return;
}
Registering the class results in GetLastError() returning 0x57 which translates to "Cannot create a file when that file already exists" which is horribly cryptic at best as I am not directly writing to any files.
Is there a better way for me to create this simple, blank window, or a better way for me to debug this beyond what I've already done?
المحلول
Error code 0x57 does not have anything to do with files. It is ERROR_INVALID_PARAMETER.
Looking at your code, you have only filled in four of the ten members of WNDCLASS. Fill in the rest as well, and you should be fine.