PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Default font name problem  (Read 1783 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9389
  • Windows 10
    • PlanetSquires Software
Default font name problem
« on: July 11, 2016, 07:26: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.

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3326
Re: Default font name problem
« Reply #1 on: July 11, 2016, 11:44:01 PM »

This is another thing where FB differs from PB.

It is like they wanted me to use BYVAL PTR instead of BYREF.
« Last Edit: August 31, 2016, 11:45:44 PM by Jose Roca »