Want to write my own packer plugin for Total Commander. Downloaded WCX Writer's Reference and decided to create a "dummy" plugin first, which will only tell via message box that certain function has been called (still providing TC with neccessary "dummy" information).
A question: When I open any archive of my type, TC calls OpenArchive function, then ReadHeader+ProcessFile for each file. All's fine. If then I select some files and press F5 to unpack, than all's fine again. But when after opening the archive, I CLOSE it without unpacking anything, nothing happens (I expected that CloseArchive should be called). But it's not all! When I open different archive (of the same type) TC doesn't call OpenArchive, it calls ReadHeader+ProcessFile referring to the old archive, which already has been closed!
What I'm doin' wrong???
[WCX Devel] Question
Moderators: Hacker, petermad, Stefan2, white
I did all correct
If any mandatory function was exported incorrectly, then TC would not accept my plugin. CloseArchive calls normally after unpacking. ReadHeader returns 0 after every success and E_END_ARCHIVE in the end. ProcessFile returns 0 on success.
Even don't know what to think! I downloaded a sample of plugin, everything seems the same!
Will try to put my code in this downloaded sceletron. Maybe will find out the reason...
Even don't know what to think! I downloaded a sample of plugin, everything seems the same!
Will try to put my code in this downloaded sceletron. Maybe will find out the reason...
If I understand the question correctly, it is similar to the one that I have.
How can my packer plugin detect, whether or not an archive that is handled by it, is currently open in one (or more) of Total Commander's panels?
As far as I understand "WCX Writer's Reference", TC calls the CloseArchive() function not when the user "leaves" the archive, but when the plugin has finished listing or extracting its contents.
Background of my question is, that I want my plugin to act different according to the situation (like TC's built-in ZIP packer does):
How can my packer plugin detect, whether or not an archive that is handled by it, is currently open in one (or more) of Total Commander's panels?
As far as I understand "WCX Writer's Reference", TC calls the CloseArchive() function not when the user "leaves" the archive, but when the plugin has finished listing or extracting its contents.
Background of my question is, that I want my plugin to act different according to the situation (like TC's built-in ZIP packer does):
- When the target file already exists, and is currently *closed*, and the user has selected files in the other panel and chooses "Files" > "Pack...", then (s)he should be asked something like "Archive <target> already exists. Overwrite? [Yes] [No]".
- When the target file already exists, and is currently *open*, and the user has selected files in the other panel and chooses "Copy" then (s)he should be asked something like "<Source> already exists in archive <target>. Overwrite <source>? [Yes] [No]".
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
- ghisler(Author)
- Site Admin
- Posts: 50830
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2Juergen
I'm sorry but you can't find out - and you shouldn't do this either! It's better to ask about the overwritten files.
I'm sorry but you can't find out - and you shouldn't do this either! It's better to ask about the overwritten files.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I see, thanks for the reply. There is still something unclear, I probably have expressesd myself ambiguously.
When the user wants to create a new archive, and that archive already exists, then I want the plugin to ask whether (s)he actiually wants to overwrite it. But when the user wants to add files to an existing archive, then the plugin should not ask whether the archive shall be overwritten, because the files will be added to it, and will not overwrite it.
So how can the plugin react adequately, when it doesn't know the situation?
Regards, Juergen
When the user wants to create a new archive, and that archive already exists, then I want the plugin to ask whether (s)he actiually wants to overwrite it. But when the user wants to add files to an existing archive, then the plugin should not ask whether the archive shall be overwritten, because the files will be added to it, and will not overwrite it.
So how can the plugin react adequately, when it doesn't know the situation?
Regards, Juergen