C ++ v C# [英] C++ v C#

查看:114
本文介绍了C ++ v C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++类库,它有数百个方法,每个方法都有静态变量的
分数。显然,我不能在一个

C#项目中引用这个库,所以我必须转换(对吗?)。


将类库转换为c#I''我需要消除静态的
变量(对吗?)。为此,我可以在课堂级别声明它们,或者我可以将b $ b分成几个类。还有其他方法吗?对于这个库,这是一项非常繁重的任务。


Microsoft开发人员是用C#编写代码还是秘密使用C ++?

解决方案

MS有许多产品采用多种技术实现,C ++

和C#包含在内。他们没有一种语言可以编写所有的产品。


至于转换类库,实际上没有必要这样做。

你总是可以在你公开的类周围创建一个COM包装器,然后在你的.NET项目中引用它,或者创建一个托管包装然后

引用。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" mr peanut" < mr ****** @ discussion.microsoft.com写信息

新闻:FF ********************** ************ @ microsof t.com ...


>我有一个C ++类库,它有数百个方法每个都有

得分的静态变量。很明显,我不能在这个库中引用这个库。所以我必须转换(对吧?)。


转换类库到c#我需要消除静态的

变量(对吧?)。为了做到这一点,我可以在课堂上声明它们或者我可以将b $ b打破几个班级。还有其他方法吗?对于这个库,这是一个非常繁重的任务。


Microsoft开发人员用C#编写代码还是秘密使用C ++?


我在哪里可以学习如何使用这个COM包装器?


" Nicholas Paldino [.NET / C#MVP] "写道:


MS有许多产品采用多种技术实现,C ++

和C#包括在内。他们没有一种语言可以编写所有的产品。


至于转换类库,实际上没有必要这样做。

你总是可以在你公开的类周围创建一个COM包装器,然后在你的.NET项目中引用它,或者创建一个托管包装然后

参考。


-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" mr peanut" < mr ****** @ discussion.microsoft.com写信息

新闻:FF ********************** ************ @ microsof t.com ...


我有一个C ++类库,每个都有数百个方法拥有

得分的静态变量。很明显,我不能在这个库中引用这个库。所以我必须转换(对吧?)。


转换类库到c#我需要消除静态的

变量(对吧?)。为了做到这一点,我可以在课堂上声明它们或者我可以将b $ b打破几个班级。还有其他方法吗?对于这个库,这是一项非常繁重的任务。


Microsoft开发人员是用C#编写代码还是秘密使用C ++?




" mr peanut" < mr ****** @ discuss.microsoft.com写信息

新闻:C1 ********************** ************ @ microsof t.com ...


我在哪里可以学习如何做这个COM包装?


Nicholas Paldino [.NET / C#MVP]"写道:


> MS有许多产品采用多种技术实现,包括C ++和C#。他们没有一种语言可以编写所有产品。

至于转换类库,确实没有必要这样做。
你总是可以围绕你公开的类创建一个COM包装器,然后在你的.NET项目中引用它,或者创建一个托管包装器然后
引用它。 br />
-
- Nicholas Paldino [.NET / C#MVP]
- mv * @ spam.guard.caspershouse.com

花生先生 < mr ****** @ discussion.microsoft.com写信息
新闻:FF ************************** ******** @ microso ft.com ...


>我有一个C ++类库,它有数百个方法,每个都有

静态变量得分。显然,我不能参考这个库



a

C#项目所以我必须转换(对吗?)。

在将类库转换为c#时,我需要消除静态的

变量(对吗?)。为了做到这一点,我可以在课堂上声明它们或者我可以将b $ b打破几个班级。还有其他方法吗?这是

a

这个库非常繁重。


Microsoft开发人员用C#编写代码还是秘密使用C ++?





不要说明显而已,但你是否尝试在COM上进行Google搜索

包装器。当然你的答案在于275万个结果中,在前10个结果中可能是7或8倍。


I have a class library in C++ and it has hundreds of methods each having
scores of static variables. Evidently, I cannot reference this library in a
C# project so I must convert (right?).

In converting the class library to c# I''ll need to eliminate the static
variables (right?). To do so, I could declare them at class level or I could
break the library into several classes. Is there any other way? This is a
VERY heavy task with this library.

Do Microsoft developers code in C# or are they secretly using C++?

解决方案

MS has a number of products implemented in a number of technologies, C++
and C# included. There is no one language that they code all of their
product offerings in.

As for converting class libraries, there is really no need to do that.
You can always create a COM wrapper around the classes you expose, and then
reference that in your .NET projects, or create a managed wrapper and then
reference that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mr peanut" <mr******@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...

>I have a class library in C++ and it has hundreds of methods each having
scores of static variables. Evidently, I cannot reference this library in
a
C# project so I must convert (right?).

In converting the class library to c# I''ll need to eliminate the static
variables (right?). To do so, I could declare them at class level or I
could
break the library into several classes. Is there any other way? This is a
VERY heavy task with this library.

Do Microsoft developers code in C# or are they secretly using C++?



Where can I learn how to do this COM wrapper?

"Nicholas Paldino [.NET/C# MVP]" wrote:

MS has a number of products implemented in a number of technologies, C++
and C# included. There is no one language that they code all of their
product offerings in.

As for converting class libraries, there is really no need to do that.
You can always create a COM wrapper around the classes you expose, and then
reference that in your .NET projects, or create a managed wrapper and then
reference that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mr peanut" <mr******@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...

I have a class library in C++ and it has hundreds of methods each having
scores of static variables. Evidently, I cannot reference this library in
a
C# project so I must convert (right?).

In converting the class library to c# I''ll need to eliminate the static
variables (right?). To do so, I could declare them at class level or I
could
break the library into several classes. Is there any other way? This is a
VERY heavy task with this library.

Do Microsoft developers code in C# or are they secretly using C++?




"mr peanut" <mr******@discussions.microsoft.comwrote in message
news:C1**********************************@microsof t.com...

Where can I learn how to do this COM wrapper?

"Nicholas Paldino [.NET/C# MVP]" wrote:

> MS has a number of products implemented in a number of technologies,
C++
and C# included. There is no one language that they code all of their
product offerings in.

As for converting class libraries, there is really no need to do
that.
You can always create a COM wrapper around the classes you expose, and
then
reference that in your .NET projects, or create a managed wrapper and
then
reference that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mr peanut" <mr******@discussions.microsoft.comwrote in message
news:FF**********************************@microso ft.com...

>I have a class library in C++ and it has hundreds of methods each having
scores of static variables. Evidently, I cannot reference this library
in
a
C# project so I must convert (right?).

In converting the class library to c# I''ll need to eliminate the static
variables (right?). To do so, I could declare them at class level or I
could
break the library into several classes. Is there any other way? This is
a
VERY heavy task with this library.

Do Microsoft developers code in C# or are they secretly using C++?



Not to state the obvious, but did you try doing a Google search on COM
wrapper. Surely your answer lies somewhere in the 2.75 million results,
probably 7 or 8 times in the first 10 results.


这篇关于C ++ v C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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