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, sheep, Hacker, Stefan2

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

Are plugins written in .NET possible?

Post by *wanderer » 2010-02-16, 21:12 UTC

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 -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Latest TC / Win7x64 SP1, WinXPx32 SP3

User avatar
MVV
Power Member
Power Member
Posts: 8129
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2010-02-16, 23:56 UTC

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: 1300
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer » 2010-02-17, 00:04 UTC

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 -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Latest TC / Win7x64 SP1, WinXPx32 SP3

User avatar
MVV
Power Member
Power Member
Posts: 8129
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2010-02-17, 00:10 UTC

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: 4973
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK » 2010-02-17, 00:25 UTC


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

Post by *wanderer » 2010-02-17, 06:36 UTC

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 -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Latest TC / Win7x64 SP1, WinXPx32 SP3

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

Post by *wanderer » 2010-02-17, 06:45 UTC

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 -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Latest TC / Win7x64 SP1, WinXPx32 SP3

MariusC
Junior Member
Junior Member
Posts: 11
Joined: 2005-03-24, 10:01 UTC

Post by *MariusC » 2010-06-16, 06:53 UTC

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: 8129
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2010-06-16, 06:56 UTC

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 » 2010-06-16, 07:22 UTC

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: 8129
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2010-06-16, 08:00 UTC

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 » 2010-06-16, 08:45 UTC

Thanks for pointing me to this. Will take a deeper look.

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

Post by *wanderer » 2010-06-16, 08:49 UTC

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 -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Latest TC / Win7x64 SP1, WinXPx32 SP3

User avatar
tbeu
Power Member
Power Member
Posts: 1197
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu » 2010-06-17, 13:41 UTC

Unfortunately this WFX .Net wrapper is buggy and no longer maintained.
TC plugins: Autodesk 3ds Max Preview, Autodesk Revit Preview, Blat Mailer, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

User avatar
tbeu
Power Member
Power Member
Posts: 1197
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu » 2010-07-06, 18:07 UTC

I just came across http://www.codeproject.com/KB/files/ManagedTCPLugin.aspx which was new to me.
TC plugins: Autodesk 3ds Max Preview, Autodesk Revit Preview, Blat Mailer, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

Post Reply