if (this->m_hWnd = CreateWindowEx(
0,
this->m_szClassName.c_str(),
this->m_szAppName.c_str(),
WS_DLGFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZE,
(GetSystemMetrics(SM_CXSCREEN) - _windowRC.right) / 2,
(GetSystemMetrics(SM_CXSCREEN) - _windowRC.bottom) / 2,
_windowRC.right, _windowRC.bottom, nullptr, nullptr, nullptr, this
);/*';' underlined in red*/ !this->m_hWnd)
throw runtime_error("Error, can't create main window!"s);
我正在重写YouTube代码,试图弄清楚它是如何工作的,我之前写过类似的条件,但没有发生这样的错误
if (this->m_hWnd = CreateWindowEx(
0,
this->m_szClassName.c_str(),
this->m_szAppName.c_str(),
WS_DLGFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZE,
(GetSystemMetrics(SM_CXSCREEN) - _windowRC.right) / 2,
(GetSystemMetrics(SM_CXSCREEN) - _windowRC.bottom) / 2,
_windowRC.right, _windowRC.bottom, nullptr, nullptr, nullptr, this
)
插入
); if (
!this->m_hWnd)
throw runtime_error("Error, can't create main window!"s);
...或类似的,那就有意义了。