CPP文件有什么用? [英] What's the use of CPP files?

查看:96
本文介绍了CPP文件有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我只是想知道为什么VC ++ .NET将所有代码放在头文件中?

为什么不使用cpp文件?这两种文件的方法是什么?


我已经阅读了这个新闻组的评论,表明微软已经退出cpp文件并转移到1文件方法。好吧,对我来说,

微软没有这样的计划他们刚刚实现了2文件系统

在C#Express中(引入了部分类)我用过C#2005

并且想知道为什么微软没有在
C ++ / CLI中实现这种方法。在创建表单时,C#自动创建另一个文件,以便

存储所有编译器生成的代码(控件初始化,

等):

例如。


myForm.cs

-myForm.designer.cs


我也讨厌它编译器自动将范围放在您的

事件或控件上......

例如


private:System :: Windows: :Forms :: TextBox ^ textBox1;

private:System :: Windows :: Forms :: TextBox ^ textBox2;


而不是
<私人:

系统:: Windows :: Forms :: TextBox ^ textBox1;

系统:: Windows :: Forms :: TextBox ^ textBox2 ;


为了公平对待微软,他们在升级

语言本身方面做得非常好。 (现在我没有看到__underscores)=)


欢呼


Paul June A. Domag
nth geographics和geometrics

解决方案

wraith写道:

大家好,
<我只是想知道为什么VC ++ .NET将所有代码放在标题
文件中?为什么不使用th cpp文件?这两种文件的方法是什么?




简单的答案:因为Winforms的设计者用G#设计了

介意。


-cd


Hello Carl,

wraith写道:

大家好,

我只是想知道为什么VC ++ .NET将其所有代码放在标题
文件中?为什么不使用th cpp文件?这两个文件的方法是什么?

简单的答案是:因为Winforms设计师在脑海中设计了C#。



这意味着Visual Studio将重点放在C#上,在此过程中放弃C ++?

我是一名C ++开发人员,通常我使用.NET for Windows Forms

接口,但我觉得非常令人不安令人讨厌的事实是

VStudio将所有代码放入.h。这个,以及在切换到设计视图时导致

loooong加载时间的错误,绑定我将所有

函数体手动移动到.cpp文件,并等待几分钟

(有时需要很多分钟。例如:大型表格需要20-30分钟)每次修改.h文件并切换到设计视图的时间。我知道

这个bug有一个KB补丁,但只适用于英语和德语

版本,而且我是西班牙语,所以我必须等待那些分钟。


MS对C ++开发人员的想法是什么?

PD:对不起我的英语不好。

- cd



-

JacoboRodríguezVillar


TyphoonLabs首席程序员

http://www.typhoonlabs.com


Jacobo Rodriguez Villar写道:

简单的答案:因为Winforms设计师在设计时考虑到了C#。
这意味着Visual Studio将专注于C#,在
过程中放弃C ++?




当然不是。我只是意味着Winforms设计人员在设计时考虑到了C#,因此不适合C ++。

MS对C ++开发人员有什么想法?




在Visual

Studio 2005中查看有关C ++ / CLI和其他新C ++功能的所有文档。不要担心,我们C ++开发人员不会落后 - 不是通过

a远射。


-cd


Hi to all,

Im just wondering on why VC++ .NET puts all of its code in the header file?
why not use th cpp file? wheres the two file approach?

I''ve read a comment on this newsgroup that suggests that microsoft is
dropping off cpp files and moving to the 1 file approach. Well for me,
microsoft has no such plans for they have just implemented the 2 file system
in C# Express (with the introduction of partial classes) i''ve used C# 2005
and was wondering why microsoft hasn''t implemented this kind of approach in
C++/CLI. Upon creating a form, C# automatically creates another file to
store all of the compiler generated code (Initialization of controls,
etc..):
eg.

myForm.cs
-myForm.designer.cs

I also hate it when the compiler automatilcally places the scope on your
event or control...
eg

private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::TextBox^ textBox2;

instead of

private:
System::Windows::Forms::TextBox^ textBox1;
System::Windows::Forms::TextBox^ textBox2;

In fairness to microsoft, they have done a very good job on upgrading the
language itself. (Now I don''t see any __underscores) =)


cheers

Paul June A. Domag
nth geographics and geometrics

解决方案

wraith wrote:

Hi to all,

Im just wondering on why VC++ .NET puts all of its code in the header
file? why not use th cpp file? wheres the two file approach?



The simple answer: because the Winforms designers were designed with C# in
mind.

-cd


Hello Carl,

wraith wrote:

Hi to all,

Im just wondering on why VC++ .NET puts all of its code in the header
file? why not use th cpp file? wheres the two file approach?

The simple answer: because the Winforms designers were designed with C# in
mind.


This means that Visual Studio will focus on C#, dropping C++ in the process?
I am a C++ developer, and usually I use .NET for Windows Forms
interfaces, but I find very disturbing and annoying the fact that
VStudio puts all the code into the .h. This, and the bug that causes
loooong load times when switch to design view, binds me to move all
function bodies manually to the .cpp file, and wait some minutes
(sometimes a LOT of minutes. e.g: 20-30 minutes for large forms) every
time that I modify the .h file and switch to design view. I know that
there are a KB patch for this bug, but only for English and German
versions, and I''m spanish, so I MUST wait those minutes ever.

What do MS have in mind about C++ developers?
P.D: sorry for my bad english, please.
-cd


--
Jacobo Rodríguez Villar

TyphoonLabs Lead Programmer

http://www.typhoonlabs.com


Jacobo Rodriguez Villar wrote:

The simple answer: because the Winforms designers were designed with
C# in mind.
This means that Visual Studio will focus on C#, dropping C++ in the
process?



Of course not. I simply means that the Winforms designers were designed
with C# in mind and so are not ideal for C++.
What do MS have in mind about C++ developers?



See all the documentation about C++/CLI and other new C++ features in Visual
Studio 2005. Fear not, us C++ developers are not being left behind - not by
a long shot.

-cd


这篇关于CPP文件有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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