From: Peter Olcott on

"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
message news:4p87q5hlmgm2b8ctuvs4s3tl742empsg2e(a)4ax.com...
>I agree. I have many slide disbributed through my Systems
>Programming course, which cover
> what happens when the Win32 API meets MFC, and it is not
> not always obvious what happens
> unless you understand both the API and MFC. And not at a
> superficial level.
>
> You can't really understand MFC unless you understand the
> concept of handle maps and
> temporary objects. Yes, I successfully worked in it for
> two years before I got the deep
> insights, but I found that they were critical to my future
> success. Now I teach how to
> use both STL and MFC collections at the interfaces.
> joe
>
> On Fri, 19 Mar 2010 03:39:55 -0700 (PDT), Goran
> <goran.pusic(a)gmail.com> wrote:
>
>>On Mar 18, 7:43 pm, "Peter Olcott" <NoS...(a)OCR4Screen.com>
>>wrote:
>>> Since I have no idea what an HFONT is (other than a
>>> handle
>>> to a font) or how it works, knowing this does not help.
>>> Learning MFC programming in terms of Win32 programming
>>> only
>>> works if you know Win32 programming.
>>
>>That's a silly thing to say, and thinking that way won't
>>get you far
>>with MFC.
>>
>>MFC really is a rather thin layer over Win32. That
>>influences very
>>much how it's made and what it does. And indeed, if you
>>look at docs
>>for MFC, there is often corresponding Win32 function link
>>at the end,
>>and doc for it is pretty much the same then.
>>
>>For example, you work with LOGFONT. That has nothing to do
>>with MFC
>>and all to do with Win32. So you in fact do Win32, not
>>MFC,
>>programming, when you handle it. Your trouble here with
>>selecting
>>stuff into DC stems from poorly understanding both Win32
>>and MFC in
>>that area. What's worse, your "functional requirements"
>>you throw
>>around are wrong because of that.
>>
>>You just shouldn't be doing this. There's no abstraction
>>that doesn't
>>leak (see http://en.wikipedia.org/wiki/Leaky_abstraction),
>>and MFC is
>>indeed an abstraction that leaks a lot, probably more than
>>it has to.
>>If you want stronger abstractions, use a better framework.

I will be porting my system without the need of a framework.
As long as LibPNG does not leak, I should be good to go.

>>
>>Goran.
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm