Page 1 of 1

C++ bridge for C# plugins

Posted: 28 Sep 2025, 18:22
by KRtek™
https://github.com/OpenSalamander/salam ... ssions/178

I find it easier to write the plugins in C#...

Example plugin that hosts managed WinForms C# .NET application.
PR: https://github.com/OpenSalamander/salamander/pull/177 or branch: https://github.com/KRtkovo-eu-AI/salama ... emo_plugin
2025-09-28 08_12_36-plugins - Open Salamander 5.0 (x64) (Administrator).png
2025-09-28 08_12_36-plugins - Open Salamander 5.0 (x64) (Administrator).png (28.14 KiB) Viewed 228 times
2025-09-28 08_13_04-plugins - Open Salamander 5.0 (x64) (Administrator).png
2025-09-28 08_13_04-plugins - Open Salamander 5.0 (x64) (Administrator).png (30.99 KiB) Viewed 228 times


Example of the usage - Json Viewer plugin: https://github.com/KRtkovo-eu-AI/salama ... nViewerNET (which is refactored this application: https://github.com/KRtkovo-eu/JsonViewe ... Salamander )
2025-09-28 15_37_12-temp - Open Salamander 5.0 (x64) (Administrator).png
2025-09-28 15_37_12-temp - Open Salamander 5.0 (x64) (Administrator).png (29.1 KiB) Viewed 228 times
2025-09-28 15_37_02-temp - Open Salamander 5.0 (x64) (Administrator).png
2025-09-28 15_37_02-temp - Open Salamander 5.0 (x64) (Administrator).png (37.48 KiB) Viewed 228 times
2025-09-28 15_37_27-.png
2025-09-28 15_37_27-.png (54.08 KiB) Viewed 228 times

Re: C++ bridge for C# plugins

Posted: 28 Sep 2025, 20:14
by AD7
Nice! Is it compatible with AS 4.0?

Sorry, but I can't see images.

Image

Re: C++ bridge for C# plugins

Posted: 28 Sep 2025, 22:11
by KRtek™
The only thing that will block the currently compiled examples is this code which will require Salamander 5.0

https://github.com/KRtkovo-eu-AI/salama ... o.cpp#L108
    // this plugin is made for the latest Salamander version - check it
    if (SalamanderVersion < LAST_VERSION_OF_SALAMANDER)
    { // we block the older versions
        MessageBox(salamander->GetParentWindow(),
                   REQUIRE_LAST_VERSION_OF_SALAMANDER,
                   PluginNameEN, MB_OK | MB_ICONERROR);
        return NULL;
    }

C++ bridge for C# plugins could be used even for 4.0 and older, if plugin is compiled with that version set.