000
22.09.2008, 18:49 Uhr
xXx
Devil
|
C++: |
void Window::create(const unsigned long x, const unsigned long y, const unsigned long width, const unsigned long height, std::wstring const & classname, const unsigned long style, const unsigned long exstyle, std::wstring const & caption, const std::size_t id, const Window* ptr_parent) { const ::HINSTANCE instance(::GetModuleHandleW(NULL)); ::WNDCLASSEXW wc = { 0 };
if (::GetClassInfoExW(NULL, classname.c_str(), &wc) == 0 && ::GetClassInfoExW(instance, classname.c_str(), &wc) == 0) { wc.cbSize = sizeof(::WNDCLASSEXW); wc.lpfnWndProc = &Window::__message_proc; wc.hInstance = instance; wc.hIcon = ::LoadIconW(NULL, IDI_APPLICATION); wc.hCursor = ::LoadCursorW(NULL, IDC_ARROW); wc.hbrBackground = ::CreateSolidBrush(RGB(40, 40, 40)); wc.lpszClassName = classname.c_str(); if (::RegisterClassExW(&wc) != 0) throw std::runtime_error("class registration failed"); }
if ((m_hWnd = ::CreateWindowExW(exstyle, classname.c_str(), caption.c_str(), style, x, y, width, height, (ptr_parent ? ptr_parent->get_handle() : NULL), ptr_parent ? reinterpret_cast<::HMENU>(id) : NULL, instance, static_cast<LPVOID>(this))) == NULL) throw std::runtime_error("window could not be created"); }
|
... da wird die 1. Exception schon geworden und GetLastError gibt 2 zurück, was für "Das System kann die angegebene Datei nicht finden" steht.
Jemand ne Idee woran das liegt? Hab ja nichtmals eigene Icons oder sonstwas verwendet ... |