Struggling with 64-bit wcx 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
maestro3
Junior Member
Junior Member
Posts: 9
Joined: 2011-02-02, 08:54 UTC

Struggling with 64-bit wcx plugin

Post by *maestro3 »

For whatever reasons I am unable to get a 64-bit wcx framework working with Delphi XE7. TC's 64-bit response is always "Cannot load plugin". If I compile for 32-bit with TC 32-bit then the plugin gets loaded and displays the message box I'd expect.

Can someone help (e.g. having a 64-bit framework for wcx plugin) what needs to be done to get it working with TC-64bit?

Thanks
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Did you export all necessary functions? How does the plugin line in your wincmd.ini look like?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
maestro3
Junior Member
Junior Member
Posts: 9
Joined: 2011-02-02, 08:54 UTC

Post by *maestro3 »

Well I guess so. These are the exported funtions:

Code: Select all

  OpenArchiveW,
  ReadHeaderExW,
  ProcessFileW,
  CloseArchive,
  SetChangeVolProcW,
  SetProcessDataProcW,
  GetPackerCaps,
  PackFilesW,
  DeleteFilesW,
  CanYouHandleThisFileW
and these are the corresponding declarations:

Code: Select all

function  OpenArchiveW(var ArchiveDataW: TOpenArchiveDataW): THandle; stdcall;
function ReadHeaderExW(hArcData: THandle; var HeaderDataExW: THeaderDataExW): integer; stdcall;
function  ProcessFileW(hArcData: THandle; Operation: integer; DestPath, DestName: PChar):
  integer; stdcall;
function  CloseArchive(hArcData: THandle): integer; stdcall;
procedure SetChangeVolProcW(hArcData: THandle; pChangeVolProc: TChangeVolProc); stdcall;
procedure SetProcessDataProcW(hArcData: THandle; pProcessDataProc: TProcessDataProc); stdcall;
function  GetPackerCaps: integer; stdcall;
function  PackFilesW(PackedFile, SubPath, SrcPath, AddList: PChar; Flags: integer):
  integer; stdcall;
function  DeleteFilesW(PackedFile, DeleteList: PChar): integer; stdcall;
function  CanYouHandleThisFileW(FileName: PChar): boolean; stdcall;
The functions OpenArchiveW and ReadHeaderExW actually just show a dialog so I am aware that the function is called.

This is the line from wincmd.ini

Code: Select all

[PackerPlugins]
CSa=192,C:\VMShare\Delphi XE7\Projekte\TC_Plugins\CSa_gpWCX\Win64\Debug\GpStructuredStoragePacker.wcx64
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

I currently can't test it in detail, but AFAIK you need the NORMAL non-wide functions too, no matter if they are not going to be used anyway:

OpenArchive
PackFiles
ProcessFile
ReadHeader
ReadHeaderEx
SetChangeVolProc
...


So just make these function "dummies", i.e. return E_BAD_ARCHIVE or so.
TC can't know in advance if the plug-in is Unicode-only, so it still needs the old functions exported, as a certain "signature".

I wonder why it works in 32-bit though.
So maybe it's some different problem.
TC plugins: PCREsearch and RegXtract
maestro3
Junior Member
Junior Member
Posts: 9
Joined: 2011-02-02, 08:54 UTC

Post by *maestro3 »

This was the key implementing the non-Unicode functions

It worked in 32-bit because there the non-Unicode functions were already implemented...

Thanks a lot. :D
Post Reply