Lazarus

Programming => General => Topic started by: bobonwhidbey on June 14, 2021, 07:07:26 pm

Title: [Solved] Virtual tree demos
Post by: bobonwhidbey on June 14, 2021, 07:07:26 pm
I'm trying to learn about the virtual tree components by studying the demos and reading the CHM help file. The CHM help file downloaded from GetHub has 2.4 MB but there doesn't seem to be any content....just index. See attached jpg.

The minimal demo program, and some other demos, include a 2nd window with [HINT] info. See attachment. How can I remove this window from the project?
Title: Re: Virtual tree demos
Post by: wp on June 14, 2021, 07:27:54 pm
I'm trying to learn about the virtual tree components by studying the demos and reading the CHM help file. The CHM help file downloaded from GetHub has 2.4 MB but there doesn't seem to be any content....just index. See attached jpg.
This is another annoyance when Microsoft eagerly had introduced a new feature (the chm help format), but later they noticed that they had opened a lot of security issues and they fixed it by inhibiting user access to this feature.

In this case it is the potential issue that the downloaded file might be harmful and prevents access to it. But you can by-pass this barrier when you right-click on the chm file in the explorer and select Properties. At the bottom of the "general" tab there's a checkbox saying that this file is from another computer and possibly poses a security issue, but you are allowed to access the file by checking the checkbox. Of course at your own risk  ;D

This is for Windows 10. Maybe Windows 7 was less restrictive, but if not, the issue probably can be handled in a similar way.


The minimal demo program, and some other demos, include a 2nd window with [HINT] info. See attachment. How can I remove this window from the project?
You mean the second black Window? This is the console output. You can disable it normally by going to the Project Options and checking the "Win32 gui application" checkbox under "Compiler Options" > "Config and Target" (by default it is checked, but programmers sometimes turn it off to see debug output).
Title: Re: [Solved] Virtual tree demos
Post by: bobonwhidbey on June 14, 2021, 07:59:51 pm
I was premature in noting this as 'solved'.  The first question (console window) was solved but not the CHM file problem.  I checked the correct property on the General tab, but no change appeared.  I still can not view the content of various pages - just the index.
Title: Re: Virtual tree demos
Post by: wp on June 14, 2021, 11:18:56 pm
Maybe this helps: https://www.helpsmith.com/chm-cannot-be-displayed.php (option #4?)
Title: Re: Virtual tree demos
Post by: bobonwhidbey on June 15, 2021, 12:35:11 am
That did it.   ;D All I had to do was move the CHM file out of the Downloads folder to another place (Desktop, etc.). Moral of the story - move files out of the Downloads folder.

Thank you,
Title: Re: [Solved] Virtual tree demos
Post by: Nimral on June 15, 2021, 10:07:41 am
U are sure?

I regularly get this issue when I download chm files from the internet. What I need to do is, after download, right-click the file and select "unblock".

IMHO the folder isn't the cause. I just tested it in Windows 10 ... as soon as I removed the block flag, the chm displayed fine from the "Downloads" folder. Maybe you copied the file in a way so the block flag was removed?

Title: Re: [Solved] Virtual tree demos
Post by: marcov on June 15, 2021, 01:11:20 pm
The flag can get lost if you copy to a filesystem type (read: non NTFS) that doesn't support the forked files that hold the lock. This CHM lock has existed since Windows XPsp2, so quite a while.

FPC also supports a commandline solution to do this, using "chmls unblock <x>"
Title: Re: [Solved] Virtual tree demos
Post by: bobonwhidbey on June 15, 2021, 05:11:15 pm
Yes - I first checked 'unblock'.  If I copy and move the .chm file to any other folder but Downloads, it displays correctly. If I copy it to the Downloads folder, it looks like that attached.
TinyPortal © 2005-2018