Jump to content

Managed C++ support


jogshy

Recommended Posts

Hiya, im new to the forums.

I was trying to write an effect plugin for Paint.NET using Managed C++. I tryed to add the PaintNET.core.dll, PaintNET.base.dll and PaintNET.Effects.dll ( which are DLLs in ILASM code from C# ) as "References". The problem is that it appears you didn't used the

[assembly]

statement in the AssemblyInfo.cs so could not be used by Native/Managed C++. Could you add that line to the SDK so could be possible to write plugins in C++/MC++ using the #import directive, please? Or is there any other way we could write PaintNET plugins using C++?

You should deploy the .TLBs too for other languages with COM capabilities like Java or VB6.

thanks.

Link to comment
Share on other sites

Hiya, im new to the forums.

I was trying to write an effect plugin for Paint.NET using Managed C++. I tryed to add the PaintNET.core.dll, PaintNET.base.dll and PaintNET.Effects.dll ( which are DLLs in ILASM code from C# ) as "References". The problem is that it appears you didn't used the

[assembly]

statement in the AssemblyInfo.cs so could not be used by Native/Managed C++. Could you add that line to the SDK so could be possible to write plugins in C++/MC++ using the #import directive, please? Or is there any other way we could write PaintNET plugins using C++?

You should deploy the .TLBs too for other languages with COM capabilities like Java or VB6.

thanks.

I don't think it would be easily possible to allow Java and Visual Basic forms to be coded into plug-in's for PDN, probably because Java dosen't use the .NET framework, if I'm right.

PDN is written for C#, which is basically a newer version of C++, but I guess Rick might be able to do that for next release.

Although, it would be easier mabye just to check online for some basic C# tuts, it's basically the same as C++ :wink: :)

Although don't let me sway what your going to do, of course.

Link to comment
Share on other sites

I don't think it would be easily possible to allow Java and Visual Basic forms to be coded into plug-in's for PDN, probably because Java dosen't use the .NET framework, if I'm right.

Java uses a Virtual Machine to run. Visual Basic 6.0 and older doesn't use the .NET framework either, but it's possible to make plugins in either language. It'd be a royal pain in the kiester and I don't see why you'd want to, but it's certainly possible. (You'd need some sort of wrapper written in a .NET language, though. PdN would communicate with the wrapper and the wrapper talks to the VB or Java program)

PDN is written for C#, which is basically a newer version of C++, but I guess Rick might be able to do that for next release.

Although, it would be easier mabye just to check online for some basic C# tuts, it's basically the same as C++ :wink: :)

No. Wrong on both counts. PdN is written IN C#, not FOR C#. Plugins can be written in any .NET language (or even non .NET languages, if you really feel like causing yourself misery...)

And C# is NOT a newer version of C++, not by a long shot.

And it's sure as hell not "basically the same." :roll:

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

I have not made an effort to maintain CLS compliancy for Paint.NET, and as such I cannot say for certain if VB.NET or J# would be able to be used for writing plugins. I don't see why MC++ wouldn't work, or even the new C++ for .NET syntax rewrite (whatever it's called, I forget).

In a future release I may move some of the effects over to native code because the native C++ compiler does a much better job doing certain optimizations, but I don't know how I plan to implement that. I may just move Render() methods over to a P/Invoke layer.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

I don't see why MC++ wouldn't work, or even the new C++ for .NET syntax rewrite (whatever it's called, I forget).

Well I was trying today and couldn't use the PaintNET.Effects.dll because the #import statement does not recognize the DLL as a .NET-usable one ( because I think it lacks the COMVisible attribute ).... unless there is other way to import it and use it with MC++

Link to comment
Share on other sites

PDN is written for C#, which is basically a newer version of C++, but I guess Rick might be able to do that for next release.

Although, it would be easier mabye just to check online for some basic C# tuts, it's basically the same as C++ :wink: :)

No. Wrong on both counts. PdN is written IN C#, not FOR C#. Plugins can be written in any .NET language (or even non .NET languages, if you really feel like causing yourself misery...)

Actually, I mean IN, but I mispelled it....... :? :wink:

Link to comment
Share on other sites

  • 2 weeks later...
...C#, which is basically a newer version of C++...

It'd be much more accurate saying that C# is a Java-like language created for .NET. Both have roots in C++, but the similitude with Java concepts, definitions and implementation is much more evident.

"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind."

~Dr. Seuss

Link to comment
Share on other sites

I don't think C# is similar to java.

In my opinion, C# is similar to (in this order):

1. Object Pascal / Delphi

2. C++

3. java

1. From Delphi it's inherited it's creator (former Borland employee, hired specifically for helping to create C#, a Java-clone for .net) along with a weird writeln instead of println; if you can give pointers to other similarities, please do so (don't bother mentioning RAD-visual; it's not a C# nor a Delphi exclusivity).

2. C++ is a multi-paradigm, multi-purpose, multi-platform systems development language, while C# (and obviously Java) is Object Oriented; Optimization in C++ occurs at compile-time and reached its limits a long time ago whereas in Java it's run-time and gets evolving at each minor release (there are even hardware optimizations for embedded systems that occur at load time!*).

3. Almost all constructs (syntax and semantics) are identical in both languages; the main difference is that while Java is one-language / multi-platform, C# is one of the languages of a multi-language platform.

So, I'd say:

C#--->Java--->C++

.........|-----> Smalltalk

.........|-----> Many other object-oriented languages!!

BTW, Java and C# are both enormously benefiting from each other in their continued evolution...

Panta.

* I develop for Process Control & Industrial Automation mainly in C++ (since CFront), Java and formerly C, and follow C# unfolding from it's inception. I work with R&D for a large worldwide automation enterprise.

"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind."

~Dr. Seuss

Link to comment
Share on other sites

- Almost all of the classes in System.Windows.Forms are similar to those in Delphi.

- the Properties Windows is almost identical to the Object Inspector

- try .. catch .. finally

- using / Uses

- compiling / building is fast (not as fast as in Delphi, but anyway)

- if (boolean) not if (integer) as in C

- other similarities (I need no more than a minute to find another one, but I have other things to do)

As about java, it is absolutely sluggish, its windows are awful looking, it crashes all the time... that is not even a programming language outside the Internet scope.

Link to comment
Share on other sites

1- Almost all of the classes in System.Windows.Forms are similar to those in Delphi.

2- the Properties Windows is almost identical to the Object Inspector

3- try .. catch .. finally

4- using / Uses

5- compiling / building is fast (not as fast as in Delphi, but anyway)

6- if (boolean) not if (integer) as in C

7- other similarities (I need no more than a minute to find another one, but I have other things to do)

8. As about java, it is absolutely sluggish, its windows are awful looking, it crashes all the time... that is not even a programming language outside the Internet scope.

Disclaimer: I'm in no way associated to any devilish conspiracy against C#, nor trying to promote Java; :twisted:

In fact, I find them both very useful! I just can take no more certain dogmatic gibberishes for granted... :evil:

1- common to many, many languages running at Windows; btw, Delphi is - to a certain extent - based on VB and VC++ concerning to RAD (I told you not to bother mentioning...)

2- have you ever seen BC++, CPPBuilder, JBuilder (all are IDEs) and Java (the real one)... the concept of properties (as we see them nowadays) originated from Java and then were adopted into Windows world...

3- you've gotta be kidding! Pure Java, mind you...

4- you've gotta be kidding!!

5- wait! Are we talking about languages or compilers? BTW have you ever compiled a Java program? Try it, then tell me about it...

6- tell me something new...

7- use this time to get to know Java, it may even help you in learning C#... (seriously!)

8- Now I'm confident to tell that you don't know Java at all!! So, end of discussion...

BTW, Java isn't (just) a programing language: it's a complete computational environment that runs not only Java bytecode, but also many other languages... (don't take my words for granted; just google it) ;)

[/end of C# x Java match]

[/end of who knows the most. I promise! (as long as...

"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind."

~Dr. Seuss

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...