Default font name problem

Started by Paul Squires, July 11, 2016, 07:56:18 PM

Previous topic - Next topic

Paul Squires

Hi Jose,

Looks like a problem with the default font name (I think). If I leave the font name blank in a call to CWindow.SetFont or CWindow.CreateFont then the class should use the default face name for the class. You are testing with this code:

   IF VARPTR(wszFacename) THEN wstrFaceName = wszFaceName ELSE wstrFaceName = m_wszDefaultFontName

I had assumed that if I passed a Null string as the face name that the class would use the default name.
pWindow->SetFont( "", 10, FW_BOLD)

This fails because a Null string still has an address(?)

Calling the function with a ByVal Null seems to work:
   pWindow->SetFont( byval null, 9, FW_BOLD)

Maybe also add a test to the incoming string for it's length? If the length is zero (null string) then also use the default font name.

Paul Squires
PlanetSquires Software

José Roca

#1
This is another thing where FB differs from PB.

It is like they wanted me to use BYVAL PTR instead of BYREF.