TadvTreeView no Expand/Collapse icons

I'm really out of ideas here, this is the only report we have received so far and are not able to reproduce this issue here. The reason why at runtime no icons appear can be due to resources not being loaded correctly inside the Executable. Can you debug and see if the LoadFromResource is being correctly executed? Eventually the following icons should be loaded correctly:




  FExpandNodeIcon := TTMSFNCBitmap(TTMSFNCBitmap.CreateFromResource('TTMSFNCTREEVIEWEXPAND', HInstance));
  FExpandNodeIcon.OnChange := BitmapChanged;
  FCollapseNodeIcon := TTMSFNCBitmap(TTMSFNCBitmap.CreateFromResource('TTMSFNCTREEVIEWCOLLAPSE', HInstance));
  FExpandNodeIcon.OnChange := BitmapChanged;
  FExpandNodeIconLarge := TTMSFNCBitmap(TTMSFNCBitmap.CreateFromResource('TTMSFNCTREEVIEWEXPANDLARGE', HInstance));
  FExpandNodeIconLarge.OnChange := BitmapChanged;
  FCollapseNodeIconLarge := TTMSFNCBitmap(TTMSFNCBitmap.CreateFromResource('TTMSFNCTREEVIEWCOLLAPSELARGE', HInstance));
  FCollapseNodeIconLarge.OnChange := BitmapChanged;


Inside CreateFromResource, the TResourceStream is created and uses the FindRCData in order to create the icons. Please check the code inside TTMSFNCUtils, it should return a true from FindRCData and a valid TResourceStream object.



class function TTMSFNCUtils.GetResourceStream(AResourceName: string; AInstance: NativeUInt): TResourceStream;
{$IFDEF WEBLIB}
begin
  Result := nil;
{$ENDIF}
{$IFNDEF WEBLIB}
var
  hst: NativeUInt;
  function FindRCData(ModuleHandle: HMODULE; Name: string): boolean;
  begin
    Result := FindResource(ModuleHandle, PChar(Name), PChar(RT_RCDATA)) <> 0;
  end;
begin
  Result := nil;
  hst := AInstance;
  if FindRCData(hst, AResourceName) then
    Result := TResourceStream.Create(hst, AResourceName, RT_RCDATA);
{$ENDIF}
end;

Pieter Scheldeman2020-03-28 14:54:10