什么是.NET中托管C ++的地方? [英] What is Place of Managed C++ in .NET?

查看:45
本文介绍了什么是.NET中托管C ++的地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Esteemed Developers and Experts,


我一直在使用Microsoft Visual C ++ .NET 1年。在此期间,

我已经通过互联网搜索了一些主题。关于.NET的大多数主题是与C#和Visual Basic .NET相关的
。关于Visual

C ++ .NET或托管C ++的文档较少。


我想知道以下问题的原因:

1 C#是否比Managed C ++和Visual C ++ .NET更强大?

2)Microsoft是否打算支持C#和VB .NET超过托管

C ++?

3)C#在性能方面可以取代标准C ++吗?

4)什么样的C#与Managed C ++和Visual C ++相比的优势

..NET?


我感谢您提前回复和指导。
< br $>
最好的问候

-

~~~~~~~~~~~~~~~~~~~~

?°yi ?? al?±?? malar

Alper AK ?? AY ?? Z(Bil Muh)


祝你好工作

Alper AKCAYOZ(Bil Muh)

Hello Esteemed Developers and Experts,

I have been using Microsoft Visual C++ .NET for 1 year. During this time,
I have searhed some topics over internets. Most of the topics about .NET is
related to C# and Visual Basic .NET. There are less documents about Visual
C++ .NET or Managed C++.

I wonder the reasons of below questions:
1) Is C# more powerful than Managed C++ and Visual C++ .NET?
2) Is Microsoft intending to support C# and V.B. .NET more than Managed
C++?
3) Can C# take the place of standard C++ in terms of performance?
4) What kind of advantages C# have compare to Managed C++ and Visual C++
..NET?

I thank your kind responses and guidances in advance.

Best Regards
--
~~~~~~~~~~~~~~~~~~~
?°yi ??al?±??malar
Alper AK??AY??Z (Bil Muh)

Wish You Good Work
Alper AKCAYOZ (Bil Muh)

推荐答案

>我一直在使用Microsoft Visual C ++ .NET 1年。在此期间,
> I have been using Microsoft Visual C++ .NET for 1 year. During this time,
我通过互联网搜索了一些主题。关于.NET
的大多数主题都与C#和Visual Basic .NET有关。关于Visual
C ++ .NET或Managed C ++的文档较少。

我想知道以下问题的原因:1)C#比Managed C ++和Visual C ++更强大。 NET?

C#我们不比C ++更强大。

但是C#比非托管C ++更容易创建.NET程序。更多

可读且编译速度更快。

C#似乎是从scracth设计为纯.NET程序。 C ++

仍然需要这种向后兼容性问题,所以语言

变得复杂了所有这些addtion宏'和关键字....


关于.NET的好处是VB,C#和托管C ++中的所有代码


另一个原因可能是C ++程序员喜欢非常优化的b / b $ b代码,即使需要几个月的时间来创建,而C#程序员需要一天b / b
或者所以创造这样的东西。所以我相信很多C ++

程序员不喜欢.NET的编程方式,因为他们失去了多年的b / b $ b $经验,并且必须从头开始重新学习所有东西成为一个

新手。

另一个原因可能是很多C ++程序员都进入他们的40'并且

很难跟上新技术的步伐。


然后,再一次,像我一样的C ++程序员,不要害怕被吓到

成为一个新手也存在,他们非常喜欢.NET :-)

2)Microsoft是否打算支持C#和VB .NET超过
托管C ++?

我不这么认为,由于代码库庞大,C ++仍然非常重要。

C ++仍然是对于未来10年来说非常重要,MFC也是如此。

3)C#在性能方面可以取代标准C ++吗?

目前还不是它根据我的测试,它变得非常接近。


我发现你在某些地方失去了速度,但在其他的b $ b $地方获得了速度。特别是.NET框架包含非常高的优化代码。在

我的代码中,我觉得与纯粹的C ++程序相比,我的平均速度降低了约5%,但我确实使C#版本的速度提高了7倍。 br />

测试表明.NET匹配库实际上比

非托管C ++库更快。

也许他们重新设计了.NET匹配库以获得更好的性能

获得,而旧的C ++库尚未更新。

4)C#与托管C ++和Visual $ b相比有哪些优势? $ b C ++ .NET?
I have searhed some topics over internets. Most of the topics about .NET is related to C# and Visual Basic .NET. There are less documents about Visual
C++ .NET or Managed C++.

I wonder the reasons of below questions:
1) Is C# more powerful than Managed C++ and Visual C++ .NET?
No. C# us not more powerfull than C++.
But C# is far easier to create .NET programs than unmanaged C++. Far more
readable and much faster to compile.
C# appears to be designed from the scracth up to be pure .NET programs. C++
still have a need for this backward compatibility issuses, so the language
gets complicated with all these addtion macro''s and keywords....

The nice things about the .NET is that all code in VB, C# and managed C++
looks the same except for syntax.

Another reason is maybe that C++ programmers tend to like very optimized
code, even if it takes an few months to create while a C# programmer needs a
day or so to create something like that. So I believe that a lot of C++
programmers don''t like the .NET way of programming because they lose their
years of experience and have to relearn everything from scratch becoming a
newbie.
Another reason could be that a lot of C++ programmers get in their 40''s and
have a hard time to keep up with the new technology.

Then again, a C++ programmers, like me that don''t mind to get scared away of
becoming a newbie again also exist and they are very fond of .NET :-)
2) Is Microsoft intending to support C# and V.B. .NET more than Managed C++?
I don''t think so, C++ is still very important because of the huge code base.
C++ is still ery important for the next 10 years, so is the MFC.
3) Can C# take the place of standard C++ in terms of performance?
Not at this moment but it gets pretty close according to my tests.

I discovered that you lose speed in some places, but gain speed in other
places. Especially the .NET framework contains very high optimized code. In
my code I have the feeling that I lose about 5% speed on average compared to
a pure C++ program, but I did make the C# version 7 times faster.

Tests suggests that the .NET match library is actually faster than the
unmanaged C++ library.
Maybe they redesigned the .NET match library for even better performance
gain, while the older C++ library has not been updated.
4) What kind of advantages C# have compare to Managed C++ and Visual C++ .NET?



请参阅需要.NET倡导主题在这个新闻组中。在那里讨论你想要知道的所有东西。

-
http://www.skyscan.be


非常感谢您的回复。

许多需要性能图像处理,语音识别,军事软件的系统都是用C ++开发的。在

时间过程中,C#能否在这些领域找到一个相当不错的地方?

在C#项目中,可以使用C ++代码。

因此,C#可用于性能要求的区域吗?

Olaf Baeyens写道:

Thank you very much for your response.
Many of the systems that require performance -like image processing, voice
recognition, military software- are developed in C++. In the course of the
time, can C# find a considerable a good place in these areas?
Within the projects that are in C#, using the C++ codes is possible.
Therefore, can C# be used in Performance-Required areas?
"Olaf Baeyens" wrote:


>非常感谢您的回复。
> Thank you very much for your response.
许多需要性能图像处理,语音识别,军事软件的系统都是用C ++开发的。在这个过程中,C#能否在这些领域找到一个相当不错的地方?
在C#的项目中,使用C ++代码是可能的。
因此,可以C#用于性能要求的区域?
Many of the systems that require performance -like image processing, voice
recognition, military software- are developed in C++. In the course of the
time, can C# find a considerable a good place in these areas?
Within the projects that are in C#, using the C++ codes is possible.
Therefore, can C# be used in Performance-Required areas?



我创建了成像软件,我尝试创建用户界面部分和

那些性能不太重要的东西在C#中,因为我可以更快地创建

部分。


但是我的代码库的很大一部分是使用MFC的非托管C ++。而我现在只是没有时间将它移植到C#或托管C ++,所以我已经创建了一个混合的C ++程序集,它既管理为非托管的代码行为

作为包装器。


关于.NET的好处是我可以用C#创建组件,管理

C ++ ,VB.NET ......并且可以毫无问题地自由地将它们混合在一起。

只要确保你在de class命名中避免区分大小写,使

确保它仍然可以在VB.NET中使用。但是你有一个程序可以检查名为FxCop的
兼容性,它可以分析你的代码程序集并解释你可以用非常友好的方式更改内容。


现在的问题是你要么创建一个C#程序集,要么是一个C ++管理的

程序集。您无法在C#项目中编译C ++代码。所以你最终得到了多个程序集(dll'),这对于

安装程序来说听起来很可怕,但最好使用一个.NET程序安装。设置

这样就不会造成任何问题。该设置可以自动配置

计算机,以获得足够的用户权限,以便通过网络运行该程序,并且... b $ b所以...所以没有更复杂的安装和用户最快。 :-)


我在开始时遇到的一件事就是这个MFC的事情。我发现我需要在DLL中使用MFC编译,这给了我

的问题,因为我在子文件夹中使用了程序集,这是一个很好的系统

以避免dll冲突,如果一个程序集需要一个dll的v1.2而另一个

assemblie在你的同一个程序中使用相同的名称但是有一个

不同的vesrion v1.1。我发现子文件夹的内容非常适合

none-MFC dll'。 MFC dll应该位于你的dll

和可执行文件的同一个文件夹中。


如果你从managd迁移到unmanaged,你会失去一些速度代码和返回。

因此最好将代码集中到托管代码或托管代码中,但尝试使用

来尽可能避免转换。但它很有效。


我遇到了一个小问题。我创建的项目之一是传统exe程序的
的dll插件。 dll是一个混合的manged / unmanaged dll,

将用户界面作为托管部分。但事实证明.NET

框架找不到正确的程序集,即使它们位于主dll的同一文件夹中的
。原因是因为可执行文件

位于另一个文件夹中,该插件位于另一个文件夹中。 .NET

框架试图找到.EXE文件夹中的dll而不是插件

..DLL文件夹。由于创建一个安装程序不需要安装插件在

exe程序文件夹中,假设你有2个插件具有相同的

名称?我找到了将组件安装到GAC中的解决方案。我不喜欢这样的b $ b但这是迄今为止我提出的最佳解决方案

可靠。设置当前目录并没有解决问题。


所以我希望您现在已经了解了可能的内容。 :-)


-
http:/ /www.skyscan.be


这篇关于什么是.NET中托管C ++的地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆