Ventana de registro antes de crearla en programación win32

When we register a window, we must create it before we register another window.

I read it on this page(Next Line after Figure:Windows)

http://zetcode.com/gui/winapi/firststeps/

and was wondering why ????

or is it only a good programming practise????

I am a newbie trying to learn win32 programming.Help will be greatly appreciated

preguntado el 28 de agosto de 12 a las 12:08

The article is incorrect. There is no requirement that you create a window before registering another class. In fact, most programs register all their classes during initialization at one go. -

2 Respuestas

When we register a window, we must create it before we register another window.

This is just not true. The only important thing is that you cannot create a window of some class unless that class is already registered.

It is also common to do it otherwise in practice, and I cannot see any reason why it should be considered best practice. Many real programs register all window classes they might need in runtime during their initialization, and then arbitrarily just create the windows ad-hoc during application's lifetime.

Respondido 28 ago 12, 16:08

The quoted text is also misusing terminology. You don't register windows, you register window clases. To create a window, its class must have been registered earlier. Once a window class is registered, you can create as many windows based on that class as you like. - Adrián McCarthy

That page says that "To create a window, we must first register it". That doesn't mean you have to create it after it's been registered, only that you can't create it until it's registered.

You can register as many window classes as you like without having to create any of them.

Respondido 28 ago 12, 12:08

Please read the line after Figure:Windows...It states "When we register a window, we must create it before we register another window" - manu_dilip_shah

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.