When I try to pack files i get "Error during packing" (seems function just NOT called
some code:
Fuction called only from PluginManager (http://wincmd.ru/plugring/pluginmanager.html) not from Option button in Pack dialog
Does GetPackerCaps return the right flags? For the options dialog, make sure to add PK_CAPS_OPTIONS (16) to the return value. To ensure that PackFiles is called, you need to set one or more of these:
PK_CAPS_NEW=1
Can create new archives
PK_CAPS_MODIFY=2
Can modify existing archives
PK_CAPS_MULTIPLE=4
Archive can contain multiple files
Please note that TC caches these flags in the wincmd.ini, so you may need to remove and re-add your plugin.
/* Returned by GetPackCaps */
#define PK_CAPS_NEW 1 /* Can create new archives */
#define PK_CAPS_MODIFY 2 /* Can modify exisiting archives */
#define PK_CAPS_MULTIPLE 4 /* Archive can contain multiple files */
#define PK_CAPS_DELETE 8 /* Can delete files */
#define PK_CAPS_OPTIONS 16 /* Has options dialog */
#define PK_CAPS_MEMPACK 32 /* Supports packing in memory */
#define PK_CAPS_BY_CONTENT 64 /* Detect archive type by content */
#define PK_CAPS_SEARCHTEXT 128 /* Allow searching for text in archives */
/* created with this plugin} */
#define PK_CAPS_HIDE 256 /* Show as normal files (hide packer */
/* icon), open with Ctrl+PgDn, not Enter*/
#define PK_CAPS_ENCRYPT 512 /* Plugin supports PK_PACK_ENCRYPT option*/
No, there isn't "pluginext=17,c:\path\pluginname.wcx" in ini
Seems TC just doesn't call any function from plugin (if it call GetPackerCaps() I will see messagebox, but i doesn't see it)
At first i thought about spaces in path to plugin and place it directly in c:\ but I get the same behavior - nothing happened
As I see, Total Commander calls GetPackerCaps for plugins not during installing but when you're opening pack dialog.
Anyway, it seems that some error appears when TC tries to call GetPackerCaps from your plugin, so TC unloads plugin and writes 0 as packer caps (I added messageboxes for GetPackerCaps and for attaching and detaching in DllMain and I see only attach and detach messages).
BTW, all seems to work fine when I'm executing rundll32 wcx_linker.dll,,GetPackerCaps (I see attach, GetPackerCaps and detach messages).
OK I found problem. Your .def file had no CloseArchive function. I've just added it - and TC called PackSetDefaultParams and GetPackerCaps between attach and detach on first opening pack dialog.
To Mr. Ghisler: If some required functions in plugin are missing TC shows error message saying that module is not a WCX plugin. But this message is not displayed when CloseArchive is missing - maybe you should correct it? Does TC check for all mandatory functions while installing plugin or just for some of them?
Also I think that TC may display some message to user if some mandatory function is absent in plugin (or just single message with list of mandatory functions that must be added to plugin). Maybe one function that will get functions from plugin for both install and load? So, function calls GetProcAddress for all functions and then checks if all mandatory functions are loaded and shows error message if some of them are missing (you will need to check functions presence in both cases anyway).
Hmm, may bee there is some reason add ability of making pack-only plugins without dummy mandatory functions? (if plugin do some actions with files and folders, that actually aren't packing and so, there can't be an archive to unpack)
And how to compile without dependency to MSVCRT90.DLL
When I use Multi-threaded Debug (/MTd)
I get error:
Error 1 error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup LIBCMTD.lib WCX_Linker