TadvTreeView no Expand/Collapse icons

Delphi Rio 1.3.3 release 3
TAdvTreeView 1.1.4.4
Windows 10

I have been at this all morning and finally figured I'd start with a blank project and see where I was going wrong. My blank project doesn't even have Expand/collapse icons.

I must be missing something. No need to send sample project. I create a new project drop a TAdvTreeView component on the form. All is well Audi, Mercedes, 3 cute collapse icons. Run the app they disappear. Nodes still Expand/Collapse but I have to click where the icon should be.

Tried it on 2 systems, restarted both still no joy. What am I missing? Am I having a senior moment?

Thank you,
Gary

Hi,


Please check if the resources are loaded correctly. The expand/collapse icons are inside the AdvTreeView.res file. Is it present in the source folder?
Yes, and it display's correctly in the designer. That wouldn't be the case if the .res file was missing, would it?


In the designer, the icons are loaded from the BPL, so the BPL includes the RES file, at runtime, the res file also needs to be found in order to find the icons. So Runtime is different from Designtime. Can you verify that, the application locates and finds the res file when compiling? Perhaps including it manually in your form unit?

Sorry, How do I do that?
I added {$R AdvTreeView.res} to interface and then tried implementation section. still not working.

Tried to reinstall. Activation screen comes up with registered email and code but says not valid. Really stuck now

Do you have a firewall that might interfere with the installation process?

No, but the subscription just ran out Thursday, March 07, 2020.

Hi,


We've modified your subscription, can you retry installing, it should activate now.
Pieter,

Thank you.
 After fresh install same problem.

BTW Didn't extend subscription because I downloaded trial of FNC UI Pack and am determining how what to use on future programs.

Hi, 


We have done multiple tests here on multiple systems but are still not able to reproduce the issue. We are working ofcourse with the latest version. I'm afraid that this is an issue in the version you are using. I see that you are using TMS FNC UI Pack and there the TTMSFNCTreeView is feature compatible with TAdvTreeView, so you can simply replace it.

I tried Restart Computer, Start Delphi, New project, Add TAdvTreeView to form, run, no icons. Repeat with FNCTreeview same result

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