473,395 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

.NET newby: IDE query

I'm completely new to .NET, but not C++, and have
bought VC++ .NET to learn with. I've created a
minimal GUI application to get started.

My first question is a simple one about the IDE. Why
is all the code generated in the header? Is this an
option I can turn off?

It seems to me that this code organisation is not
mandated by anything I have learned so far about
..NET. Perhaps it seems a small thing to C# and Java
developers, but I prefer to separate the interface
from the implementation. Call me old-fashioned...

Thanks.
Arnold the Aardvark
Nov 17 '05 #1
7 1245
Arnold the Aardvark wrote:
I'm completely new to .NET, but not C++, and have
bought VC++ .NET to learn with. I've created a
minimal GUI application to get started.

My first question is a simple one about the IDE. Why
is all the code generated in the header? Is this an
option I can turn off?

It seems to me that this code organisation is not
mandated by anything I have learned so far about
.NET. Perhaps it seems a small thing to C# and Java
developers, but I prefer to separate the interface
from the implementation. Call me old-fashioned...


You are not the first to notice that the C++ wizards generate all code in
the header file. They are just mimicking C#, for which code goes in a
single file and all implementations are inline. I believe you can manually
separate code into headers and source files, as you like, without confusing
the IDE.
Nov 17 '05 #2
Edward Diener wrote:
You are not the first to notice that the C++ wizards generate all code in
the header file. They are just mimicking C#, for which code goes in a
single file and all implementations are inline. I believe you can manually
separate code into headers and source files, as you like, without
confusing the IDE.


What a kludge! To M$: Were any actual C++ developers involved in creating
this tool?!

As for confusing the IDE I renamed two components (a ListView and
a Toolbar), and the pointer declarations went missing from the
generated code, so it wouldn't compile. Is this a known bug?

Thanks.
Arnold the Aardvark

Nov 17 '05 #3
Arnold the Aardvark wrote:
Edward Diener wrote:
You are not the first to notice that the C++ wizards generate all
code in the header file. They are just mimicking C#, for which code
goes in a single file and all implementations are inline. I believe
you can manually separate code into headers and source files, as you
like, without confusing the IDE.
What a kludge! To M$: Were any actual C++ developers involved in
creating this tool?!


AFIAK, no. The WinForms wizard was built by the C#/VB.NET team(s) and
adapted to C++. That was the best they could do with the available time and
resources. I believe this aspect will change in Whidbey (VS 2004), since C#
will support "partial classes".
As for confusing the IDE I renamed two components (a ListView and
a Toolbar), and the pointer declarations went missing from the
generated code, so it wouldn't compile. Is this a known bug?


Probably.

If you want to rename a WinForms object, be sure to do it from the
Properties window, not by editing the source code directly. That way the
designer will keep track of everything properly.

-cd
Nov 17 '05 #4
Carl Daniel [VC++ MVP] wrote:
AFIAK, no. The WinForms wizard was built by the C#/VB.NET team(s) and
adapted to C++.
That's what I figured, and then I thought that surely not even M$ would
be this dumb/arrogant/whatever. Heaven help us all...

Partial classes sound weird. Who owns the class? Can anyone add new methods
to a class in a library written by someone else? I suspect they will create
more problems than they solve.
If you want to rename a WinForms object, be sure to do it from the
Properties window, not by editing the source code directly. That way the
designer will keep track of everything properly.


That's what I did. Ho hum. And how about renaming the form itself? The
generated source contained a dire warning about this, whereas in C++
Builder or Delphi one simply types in the new name, as with the other
components, so it is obviously not beyond the wit of Man.

Thanks.
Arnold the Aardvark

Nov 17 '05 #5
Hi Arnold,
Partial classes sound weird. Who owns the class? Can anyone add new methods to a class in a library written by someone else?
Nope. Partial classes is entirely a compiler implemented feature, requiring
no support from the runtime, as I understand it. This means the compiler
must be able to see all parts of a partial class at compilation, which means
it only works on pieces of a class in the same assembly/module... you can't
"extend" a class existing on a compiled assembly already this way.
I suspect they will create
more problems than they solve.


Not necessarily. I believe their biggest use is going to be as a way to
extend classes generated by code-generating tools such as xsd.exe, the
designer, asp.net, wsdl.exe, and so on...

--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #6
Tomas Restrepo (MVP) wrote:
Partial classes I suspect they will create
more problems than they solve.
Not necessarily. I believe their biggest use is going to be as a way to
extend classes generated by code-generating tools such as xsd.exe, the
designer, asp.net, wsdl.exe, and so on...


You may be right, but it seems to me that the tools should be designed to
fit the language specification, rather than the reverse. I guess I'm what
you might call a bit old-fashioned.
Arnold the Aardvark

Nov 17 '05 #7
Arnold the Aardvark wrote:
Tomas Restrepo (MVP) wrote:
Partial classes I suspect they will create
more problems than they solve.

Not necessarily. I believe their biggest use is going to be as a way
to extend classes generated by code-generating tools such as
xsd.exe, the designer, asp.net, wsdl.exe, and so on...


You may be right, but it seems to me that the tools should be
designed to fit the language specification, rather than the reverse.
I guess I'm what you might call a bit old-fashioned.


That's true. It's also useful to be able to have the machine-generated part
of a class 100% isolated from the human-maintained part of the class.
Typically the machine-generated part will not be in source control (some
meta-data item, like an XML file will be instead) while the human-created
part would be in source control.

-cd
Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
9
by: Damien | last post by:
I have just built a simple stopwatch application, but when i f5 to get things goings i get this message, An unhandled exception of type 'System.ArithmeticException' occurred in...
5
by: Mary Walker | last post by:
Hi, I'm enclosed a snippet of test code which highlights my problem. The Stored procedure insertValue should insert text into the parent, then insert other text into the child table but the 2...
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
10
by: Fred Nelson | last post by:
Hi: I have programmed in VB.NET for about a year and I'm in the process of learing C#. I'm really stuck on this question - and I know it's a "newby" question: In VB.NET I have several...
12
by: Hermann W Ehlers | last post by:
Hi I need help at the very beginning. I have been writing classic ASP for some time, but getting data out of a SQL database and displaying a single value eludes me. So far I have the...
3
by: John Baker | last post by:
Hi: I am an utter virgin at ASP, but have experience in HTML! I have a very basic question. I have an ASP sheet, where I wish to permit the user to enter a code, and then return the results...
10
by: John Baker | last post by:
Hi: This is the only ASP newsgroup I can access using Verizon, and I would like to know a real basic piece of information. I am totall new to ASP, although I have done HTML coding. Say I The...
5
by: campbellbrian2001 | last post by:
Thanks all in advance. A couple of questions: I was trying to set up a form with a datagrid to display . I have a successful attachment to an Access Database (Northwind). The code below failed. I...
2
by: mike_kilby | last post by:
Hi, I am trying to set up a DTS Package to transfer data from a remote MySQL server to a local MS SQL database. The source tables will remain static as will the destination however I only want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.