Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Learning Win32 API: Managing Application State: Why template i needed?

$
0
0

Hello, everyone,

I'm learning Win programming and there is a page, which discuss management of state of windows.

Managing Application State (from Learn to Program for Windows in C++)

At the end of this article the template class is provided, which reduces boilerplate code (and makes it somehow safer) needed to create window and manage its state.

But I have the question: Why template is needed?

It seems, that proposed example should work if we use simple inheritance (of course, DERIVED_TYPE should be replaced with BaseWindow within the code of BaseWindow class implementation.

Possibly, this example is too simple and there may be cases, when simple inheritance is not enough. I would appreciate if some one would point me to such an example.

Thanks.


Dmitry Semikin


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>