PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: Paul Squires on July 11, 2016, 07:56:18 PM

Title: Default font name problem
Post by: Paul Squires on July 11, 2016, 07:56:18 PM
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.

Title: Re: Default font name problem
Post by: José Roca on July 12, 2016, 12:14:01 AM
This is another thing where FB differs from PB.

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