Plugins (C#): Is .NET out of the question?

I would like to write some plugins for Dopus (namely one for Drop.io) but unfortunately I have no C++ skills - but I do have C#.net.

Has anyone attempted this? Is it even worth trying? :slight_smile:

Thanks in advance :slight_smile:

It should be possible, but if you don't know any C++ then it might take a bit of investigation to work out how to translate the structures and DLL functions you need to work with into C#. I'll be like using P/Invoke stuff to call Win32 APIs.

It could result in problems, though... Hosting .Net within a native process which doesn't know anything about it is fine until two things try to do it. Then those two things can conflict with each other over things like which version of the .Net runtime is loaded. This is one of the reasons why it's not a good idea to write Explorer shell extensions in .Net.

That doesn't mean you can't do it, though... It just means there could be complications down the road. They're complications that could be solved, though.

If there is demand for a .Net plugin API then that could be provided as well, and it could be done in a way which avoids the potential conflicts. (e.g. By running the .Net code in a separate process which Opus creates to provide the plugin with the .Net version and environment which it specifies, and which the plugin author doesn't have to worry about.)

I think you're the first person to ask about .Net plugin writing but I don't know if that's because nobody is interested in it, or if there are people who might want to write plugins in .Net but see there isn't an API so haven't taken things further.

Personally, I've been looking for a good excuse to try writing a .Net plugin and experimenting with some kind of .Net wrapper for the plugin API for a while now, but everything I've done so far has been naturally suited to C++ (due to using a lot of Win32 native APIs or C++ library code).

DEMAND!

DEMAND![/quote]
Here pipeup :exclamation:

What kind of plugins do you guys want to write?

Simple "return a bitmap" stuff, or ones with their own UIs, or virtual filesystem ones?

[quote="leo"]What kind of plugins do you guys want to write?

Simple "return a bitmap" stuff, or ones with their own UIs, or virtual filesystem ones?[/quote]
Some with their own UIs would be of interest. Virtual filesystem also. We take all we get :open_mouth: :laughing:

Such as?

It will take a lot of work on my and/or GPSoftware's part to get a .Net API that works well so I need to know people are committed to using it and have plans to do something really useful with it, since there's a million other things I want to do as well.

I'd like to port my Plugins written in Delphi to .Net with C#.
Due to the problems concerning Delphi-Plugins, I am currently not motivated to develop my plugins further or something new because I don't like quick'n'dirty-solutions and unsolved problems (you know about TPUtilWindow, leo :wink: ).

But notice: if you do something on a .Net-API, I am not able to port all my plugins within a week, so please do not misconceive that.
Delphi is my day-to-day business, therefore it was not as difficult to develop the PlugIns.
C# is something new for me. I am learning on it during my freetime (and I don't have much freetime, since my son was born :wink: ).

Imho .Net is on the up and up.

[quote="leo"]Such as?

It will take a lot of work on my and/or GPSoftware's part to get a .Net API that works well so I need to know people are committed to using it and have plans to do something really useful with it, since there's a million other things I want to do as well.[/quote]

Such as a plugin for viewing ADS and maybe a plugin to work with graphics or a plugin to do certain operations on files. It's my daily business to write small tools in C# especially for Windows Deployment automation. So it would be great if I could use that language for DOpus plugins as well.

Those problems could be solved by moving (some) plugins into a separate process, which is another thing I'm considering making easy for people to do (and which may simplify any .Net stuff down the road as well).

A separate process would solve the TPUtilWindow issue, as well as allow for Delphi plugins to be used in 64-bit Opus. Plus the benefit of isolating the main Opus process from crashes (e.g. due to bad video codecs in the Movie plugin).

Not sure when, though. :slight_smile: I've still got a lot of other stuff I want to write first, e.g. 7zip (etc.) plugin which I will be starting after I finish my brief return to audio tag stuff.

[quote="leo"]
Not sure when, though. :slight_smile: I've still got a lot of other stuff I want to write first, e.g. 7zip (etc.) plugin which I will be starting after I finish my brief return to audio tag stuff.[/quote]
Deal with your problems first :wink:
I think it is more important to get some new plugins then to port existing ones to another language.

So - don't panic.

Why not learn C++ instead of C#? :slight_smile:

Because I can use C# in my daily business, too (some of our webservices are written in C#).
Furthermore it looks more attractive (for me).

I have some C++ books here, but never found time to read them.
Anyway - never say never :wink:

It's not worth it because "Midori" is supposed to be written completely (or almost completely) in managed code. :smiley: :sunglasses:

You're aiming for Midori? Not planning to write anything for 10-15 years? heh

Oh, I do. But it will take a 35 years old men at least 10 years to be a C++ pro. And then? I know C++ and have Midori :smiley:

Heh. :slight_smile: Well, there would still be C++.Net!

(C++.Net is pretty cool these days, although since it is more complex and intermingles with C# so well there's rarely any reason to write entire projects in it.)

[quote="leo"]Heh. :slight_smile: Well, there would still be C++.Net!

(C++.Net is pretty cool these days, although since it is more complex and intermingles with C# so well there's rarely any reason to write entire projects in it.)[/quote]
Anyway, I will have to deal with that former or later. I'm trying to do my next tool in C++. But that does not mean that I don't want a .NET plugin system for DOpus. :open_mouth: :slight_smile:

Any news on this?

DemandΒ² :wink: