Error Installing Home-Made Lister Plugin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Error Installing Home-Made Lister Plugin

Post by *JohnFredC »

I have built a little lister plug-in in Delphi that uses an ActiveX control to view a particular file type. It runs great on both TC installations I have tried it on. No problems, no crashes after it has been added.

Except: On one PC (not the other), when adding the plugin from the TC LS-Plugins dialog, the following error message appears:

"The instruction at "0x00000000" referenced memory at "0x0000000". The memory could not be "read".

- If the user clicks "OK" to terminate, then the error dialog closes, the lister plug-in appears in the LS-Plugins list and all is well from then on.

- If the user clicks "Cancel" to debug, then TC closes immediately.

Again, this only happens on one of the PCs, not the other.

What could be wrong with my plug-in? Any ideas anyone?
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

May a used function is missing in one of the DLLs.

Try to check the dependencies of your *.wlx file (on the mad PC).

(use Dependency Walker of MS or better FileInfo lister plugin)
#5767 Personal license
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

2sga

Thanks for replying!
Try to check the dependencies of your *.wlx file (on the mad PC).
That is what I first thought, but I am compiling with runtime libraries "off" and the FileInfo plug-in shows no missing DLLs on the "Mad" machine.

Plus, the plug in works fine, loads its file, displays it, etc. It crashes TC in multi-instances of the Lister, though, which I haven't figured out yet.

Maybe the two issues are related.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
Maxwish
Senior Member
Senior Member
Posts: 370
Joined: 2003-02-05, 19:13 UTC
Location: .NL

Post by *Maxwish »

Any chance of a beta test ?
...BRB...
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

2MaxWish

Actually, I have made two lister plugins: one superfluous and one not. Neither work with multiple lister instances, so I am hesitant to let them out to play in public.

The superfluous one (because its functionality is duplicated by the IE listers) is a PDF lister that simply wraps the Adobe PDF Active X control. PDFView is at v0.9... that is, finished when I get the multiple instances thing fixed. Obviously the Adobe Acrobat free viewer must already be installed.

The second is a lister for Microsoft Access report snapshot files (*.snp). It too is a wrapper, this time of the MS Snapshot viewer ActiveX. However, I added a toolbar and have other plans to enhance its functionality. Call it SNPView v0.5. Of course, the free Access snapshot browser is required (available on the MS site).

Both of these wlxs are primarily for learning purposes. I have more useful lister plugins in mind for the future.

Do you want to test either of them, even with their problems? I'd be happy for feedback.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sounds very good! To solve the multiple instances problem, just set a flag when the first instance is loaded, and reset it to zero when it is unloaded. When the flag is set, simply return NULL when TC tries to display another instance. This way the lister will show the files as normal text/binary in additional instances.
On one PC (not the other), when adding the plugin from the TC LS-Plugins dialog, the following error message appears
What is the difference between these PCs? Different versions of Windows? Different service packs? Different versions of Adobe Acrobat reader?
Author of Total Commander
https://www.ghisler.com
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Hi Christian

Best wishes for your holidays!
Different versions of Windows?
No. Same version (XP Pro).
Different service packs?
No. Same level (SP1a).
Different versions of Adobe Acrobat reader?
Yes, actually. But why should that affect the installation process???

I am experimenting with the flag you mentioned.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

2 Christian
When the flag is set, simply return NULL when TC tries to display another instance.
Result:=Null; gives a TC runtime error. Result:=0; (zero) works though.

There are too many other issues to let either of these little plugins out of the shop. Apparently my code in ListClose window isn't unloading the PDF viewer properly, for instance, so one can only view a maxium of 20 PDFs before an Acrobat "too many documents" message.

I'll be back after I get that (and other) issues solved.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I was talking about the C NULL, which is 0 in Delphi. The Null in Delphi seems to be a variant which isn't =0.
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2JohnFredC

I just downloaded PDFView 1.0 from Club Total. Thank you very much! I have one suggestion and one question:

1. There is already a plugin called PDFView. What about a new for your plugin? What about ActivePDFView?

2. Is there a list of necessary files which are required for proper work of the plugin without the need to have Acrobat Reader installed?
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Hi Lefteous!
1. There is already a plugin called PDFView. What about a new for your plugin? What about ActivePDFView?
Ok by me! I'll see about changing the name.
2. Is there a list of necessary files which are required for proper work of the plugin without the need to have Acrobat Reader installed?
I am sorry, no. You must install Acrobat reader first. That was sort of the point of it. I am learning how to write plugins and this seemed absolutely the easiest way to start. That is, let the Adobe people do all the work.

ActivePDFView :) is a simple wrapper around the Acrobat reader control. Perhaps you could delete some of the files of the Acrobat Reader and it would still work, but I wouldn't hazard a guess which ones.

Thanks for trying the plugin!
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
Dark One
Junior Member
Junior Member
Posts: 40
Joined: 2003-05-19, 10:48 UTC
Location: Serbia

Post by *Dark One »

Apparently my code in ListClose window isn't unloading the PDF viewer properly
perhaps it's not fully your fault. in an early stage, my xlsview plugin used an ActiveX control. and there was a problem - it would not fully unload and part of tc would remain in memory. tc would not show on applications page of task manager but totalcmd.exe would be there on processes page. after that, tc wouldn't load as i only allow one instance of tc.

plugin also took quite a while to load.

solution: please always use Visual Component Library.
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

2Dark One

The problem was indeed mine, after all. The following Delphi code seems to have solved the problem. At least on my machine it unloads the plugin and closes the lister cleanly. I'm not sure why... I'm an amateur at Delphi. Perhaps there are redundancies.

[face=courier]procedure ListCloseWindow(ListWin:thandle);
Var theAction: TCloseAction;
Begin
//Destroy the ActiveX control
frmMain.Pdf1.Destroy;
theAction := caFree;
frmMain.DoClose(theAction);
frmMain.release;
End;
[/face]

The forum strips my customary indentation style...
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
Post Reply