[Qt-interest] Qt C++ with some C++.NET calls
Jeroen De Wachter
jeroen.dewachter at barco.com
Fri Jan 15 15:45:46 CET 2010
Ok,
C# and C++ .NET are not the same. But Ben does have valid points in [1],
[2] and [3]. C++ .NET is rather different to work with than C++.
C++ .NET (or managed C++) is basically C++ with extra features
concerning (I think?) garbage collection and the like, and the ability
to use the .NET class library (just like you would in C# or VB.Net)
I don't know a whole lot about this, but I'm fairly sure that you will
need a number of context changes between managed (for the .NET stuff)
and unmanaged C++ (for the Qt stuff), which is possible from within .NET
but not very efficient iirc
I'm also guessing that you will end up with a very complex and hard to
debug code base if you start mixing managed and unmanaged code...
Using qmake is probably going to be difficult, btw... qmake won't know
how to compile the managed code or what flags to pass to the
compiler/linker...
One obvious question maybe: if you are going to use .NET anyway, why not
simply use the .NET class library instead of Qt? Surely (almost?)
everything that is available in Qt is also present in the .NET class
library? Plus you could switch to C# instead of C++.NET, which should
make your code much easier to write and maintain. (C# is almost exactly
like Java; it just uses the .NET class library instead of the Java one).
Kind regards,
Jeroen De Wachter
On Fri, 2010-01-15 at 06:23 -0800, BRM wrote:
> >From: Sylvain Pointeau <sylvain.pointeau at gmail.com>
> >To: qt-interest at trolltech.com
> >Sent: Fri, January 15, 2010 5:41:24 AM
> >Subject: [Qt-interest] Qt C++ with some C++.NET calls
> >I would like to know if this is possible to embed some C++.NET code into a Qt Application?
> >What do you recommend? is it possible to continue using QMake?
>
> Well, given that C++.NET (aka C#) is NOT C++[2], I don't know that that would a supported configuration, especially given the subtle changes in the languages[3].
>
> That said, it should be like embedding it into any other standard C++/Pascal/Ada/etc -based source code.
>
> HTH,
>
> Ben
>
> [1] C++.NET is as close to C++ as Java is. For all intents and purposes it is a separate language.
> [2] There are two modes for MS's C++ compiler: (a) C++, (b) Managed C++/C++.Net/C#. I take it you are referring to mode 'b'. Mode 'a' is fully supported.
> [3] C++.NET makes use of a lot of C++ keywords, but there are subtle changes that result in big differences.
> Here's some URLs (from a quick google search) on the matter:
> http://msdn.microsoft.com/en-us/magazine/cc301520.aspx
> http://msdn.microsoft.com/en-us/library/yyaad03b%28VS.71%29.aspx
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
DISCLAIMER:
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.
More information about the Qt-interest-old
mailing list