jesu 3 Posted yesterday at 07:42 AM Hello. Using 12.3 + patch 1. I'm seeing this error: Quote Access violation at address 6F75232A in module 'COMCTL32.dll' (offset 2232A). Read of address 0000000C. changing font at runtime. This is my code: procedure TFprincipal.FontNameRClick(Sender: TObject); begin ga_TipoLetra := FontNameR.Text; Font.Name := ga_TipoLetra; gn_FontSize := StrToInt(ComboSize.Text); Font.Size := gn_FontSize; Screen.MessageFont := Self.Font; ToolBar.Font.Size := Min(gn_FontSize, 14); end; The error happens at the end of that code in procedure TWinControl.DefaultHandler(var Message); inside VCL.Controls. Is it a bug or should I do something different? Thanks Share this post Link to post
Minox 8 Posted yesterday at 10:07 AM From the posted code it is not clear what values are passed, for example what is assigned to "Font.name"? You need to find out which value is not right, start disabling some lines to see if the problem disappears. Share this post Link to post
jesu 3 Posted yesterday at 11:22 AM (edited) I use this procedure to get installed fonts and allow to choose one: procedure TFprincipal.GetFontNames; var DC: HDC; begin DC := GetDC(0); EnumFonts(DC, nil, @EnumFontsProc, Pointer(FontNameR.Items)); ReleaseDC(0, DC); FontNameR.Sorted := True; end; but the problem seems to happen not when I change font name, but when I increase font size, and it doesn't happen always. If I choose a second time the same font size, the second time it seems to work. Edited yesterday at 11:23 AM by jesu Share this post Link to post
Minox 8 Posted yesterday at 12:08 PM try to monitor the values that are given to "font.size", or attach a simple project where we can check Share this post Link to post
Remy Lebeau 1595 Posted yesterday at 06:37 PM 7 hours ago, jesu said: I use this procedure to get installed fonts Why not use Screen.Fonts instead? Share this post Link to post
Anders Melander 2000 Posted yesterday at 07:07 PM My guess is that something you are doing elsewhere is corrupting memory and what you are seeing are just secondary errors. You can probably use madExcept, with memory overrun check enabled, to find the origin of the problem. Share this post Link to post