Herzlich Willkommen, lieber Gast!
  Sie befinden sich hier:

  Forum » C / C++ (WinAPI, Konsole) » RegisterClass is behinnert :D

Forum | Hilfe | Team | Links | Impressum | > Suche < | Mitglieder | Registrieren | Einloggen
  Quicklinks: MSDN-Online || STL || clib Reference Grundlagen || Literatur || E-Books || Zubehör || > F.A.Q. < || Downloads   

Autor Thread - Seiten: > 1 <
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 ...
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
001
22.09.2008, 19:01 Uhr
Kest
saint


Verschrieben? "::RegisterClassExW(&wc) == 0"
--
Wenn man einen Hufschlag hört, sollte man >Pferd< denken und nicht >Zebra<.
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
002
22.09.2008, 19:10 Uhr
xXx
Devil


nicht wirklich, oder? ich bekomm nen anfall ja lag daran ... verdammte hacke
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
Seiten: > 1 <     [ C / C++ (WinAPI, Konsole) ]  


ThWBoard 2.73 FloSoft-Edition
© by Paul Baecher & Felix Gonschorek (www.thwboard.de)

Anpassungen des Forums
© by Flo-Soft (www.flo-soft.de)

Sie sind Besucher: