I figured it out. I've gotten used to not giving much attention to warnings and hints about variables passed as API parameters but, the compiler's warning was right (not to mention very useful) in this case.
I copied and pasted a SelectObject(ps.hdc, GetStockObject(afont)) from a WM_PAINT handler to another handler where the dc variable was not ps.hdc but simply dc (a dc I was getting with GetDc.) The compiler's warning was more than justified since ps.hdc had definitely not been initialized there.
Serge, thank you for your help. My attempt to provide an example of the discrepancy lead me to find that problem. Strangely, in spite of using a junk dc in the SelectObject call, the program worked correctly (it used the right font.. go figure.)