[win32/c++] create window mislukt

Pagina: 1
Acties:

  • Krooswijk.com
  • Registratie: Mei 2000
  • Laatst online: 17-08-2024
ik heb nu iets heel vaags. ik heb een control gemaakt die in z'n constructor een functie register( ) aanroept, waarin z'n wndclass wordt geregistreerd en vervolgens z'n handle wordt gecreerd, als volgt:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
this->hwnd = CreateWindow(
                "my_control",
                "",
                style_flags | WS_VISIBLE | WS_CHILD |
                WS_BORDER,
                this->x,
                this->y,
                this->width,
                this->height,
                parent_hwnd,
                NULL,
                hinst,
                my_control );

DWORD error = GetLastError( );


Alle waardes in de CreateWindow functie zijn goed gevuld. Alleen wordt this->hwnd gevuld met een de waarde NULL, dus er treedt een fout op in de CreateWindow functie. De GetLastError functie retourneert als foutwaarde 2:
Van MSDN
code:
1
2
3
2 =
The system cannot find the file specified.
ERROR_FILE_NOT_FOUND

ik kan deze foutmelding in geen enkel verband brengen met de code. heeft iemand hier toevallig ervaring mee, komt het bekend voor?

  • curry684
  • Registratie: Juni 2000
  • Laatst online: 13-08 16:46

curry684

left part of the evil twins

Handel je de WM_CREATE correct af in de WndProc?

Professionele website nodig?


  • Krooswijk.com
  • Registratie: Mei 2000
  • Laatst online: 17-08-2024
damnit that's it, deed m'n SetWindowLong in de WM_NCCREATE en die moest in de WM_CREATE, tnx

  • curry684
  • Registratie: Juni 2000
  • Laatst online: 13-08 16:46

curry684

left part of the evil twins

Dumdiedum :)

Professionele website nodig?