const {
int width = CLASSNAME_APP_MIN_WIDTH;
int height = CLASSNAME_APP_MIN_HEIGHT;
auto parentHandle = this->getParent()->getHWND();
auto hInstance = this->getInstance();
return ::CreateWindow(
_T(CLASSNAME_CONTAINER),
nullptr,
WS_CHILD,
0, 0,
width, height,
parentHandle,
nullptr,
hInstance,
nullptr
);
}
The debugger says that CreateWindowW is trying to call a null pointer to a function deep inside user32.dll
I guess some of the parameters are wrong.
I know for sure that:
1. parentHandle comes from the hwnd parameter of WM_CREATE
2. hInstance is valid
3. the other nullptr s are not the issue.
What would you suggest?
To error check at every api call
Is parentHandle valid?
it's using the one that comes with WM_CREATE it should be valid, right?
Обсуждают сегодня