Are plugins written in .NET possible?

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

Moderators: white, Hacker, petermad, Stefan2

User avatar
wanderer
Power Member
Power Member
Posts: 1575
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Are plugins written in .NET possible?

Post by *wanderer »

I think i know the answer to this question but since i could not find anything clear on the matter, i'm asking: are ActiveX dlls (i.e. from .NET) supported by TC as plugins?
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

If your DLL acts as usuan DLL - i.e. initializes on call DllMain and exports functions that requires TC plugin interface, you may use it as plugin.
User avatar
wanderer
Power Member
Power Member
Posts: 1575
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer »

MVV wrote:If your DLL acts as usuan DLL
Well, ActiveX DLLs are not usual DLLs so i'm pretty sure if there is no special support from TC, they won't work.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

TC supports only DLLs that export functions realizing TC plugins interface (for each of four plugin types there are different functions required). If your DLL doesn't export required functions, TC won't use it as plugin DLL.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

User avatar
wanderer
Power Member
Power Member
Posts: 1575
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer »

MVV wrote:TC supports only DLLs that export functions realizing TC plugins interface
That is not a problem. The required functions can be exported. I think the problem is that the way .NET DLLs communicate with the world outside of them is different than the way classic DLLs do, so if TC does not support directly communicating with them...
...something like this could be a solution! :)

Many thanks HolgerK. I'll give it a try.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
wanderer
Power Member
Power Member
Posts: 1575
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer »

Now that i think of it, there must be a way (in recent VS.NET versions at least) to construct a .NET DLL than can be registered as a COM component. Maybe it will work...

I'll post the results of my research here for future reference...
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
MariusC
Junior Member
Junior Member
Posts: 11
Joined: 2005-03-24, 10:01 UTC

Post by *MariusC »

Something new regarding support of .NET? I'm highly interested in doing a plugin for reading .MSI (the existing one are limited and not very useable)
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

MariusC wrote:Something new regarding support of .NET? I'm highly interested in doing a plugin for reading .MSI (the existing one are limited and not very useable)
I suggest not to wait and start to write it:) later you (or someone else) can write simple wrapper that will allow to connect your plugin to TC.
MariusC
Junior Member
Junior Member
Posts: 11
Joined: 2005-03-24, 10:01 UTC

Post by *MariusC »

A version that is running outside TC is already finished. I need to hook into TC to display f.e. streams and tables as directories and files.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think this should help you to convert your managed DLL to mixed that contains managed code and unmanaged exported functions. You need just to export functions described in TC plugin interface manual.
MariusC
Junior Member
Junior Member
Posts: 11
Joined: 2005-03-24, 10:01 UTC

Post by *MariusC »

Thanks for pointing me to this. Will take a deeper look.
User avatar
wanderer
Power Member
Power Member
Posts: 1575
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer »

Try the following:

- In the .NET Project options, Compile, check the "Register for COM interop" checkbox
- In the .NET Project options, Application, perhaps the "Make Assembly COM visible" checkbox should be checked.

Assuming you have the methods/properties required by TC in the DLL, maybe these two options will do the work.

If you try it, please let us know how it went.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Unfortunately this WFX .Net wrapper is buggy and no longer maintained.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

I just came across http://www.codeproject.com/KB/files/ManagedTCPLugin.aspx which was new to me.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
Post Reply