C++ Code in header files

M

Mauro Tronto

Hello, If you start a new c++ .net project (windows form) the IDE shows
window and generate 2 files (.cpp and .h). If I simple drag and drop button
control into the form and double click the button, the IDE shows me a method
"template" where I can write my code. I wonder why the IDE creates the
template in .h (header) file instead of .cpp file. I've always write
scheleton C++ class in header file and implementation code in .cpp file.
Thanks for help
Mauro
 
C

Carl Daniel [VC++ MVP]

Mauro Tronto said:
Hello, If you start a new c++ .net project (windows form) the IDE shows
window and generate 2 files (.cpp and .h). If I simple drag and drop
button control into the form and double click the button, the IDE shows me
a method "template" where I can write my code. I wonder why the IDE
creates the template in .h (header) file instead of .cpp file. I've always
write scheleton C++ class in header file and implementation code in .cpp
file.

Bottom line because the wizards were designed to generate C# code which does
not use a separate header file.

-cd
 
M

Mauro Tronto

Thanks Carl for reply.
Are there any changes in Whidbey? I've see that in C++ 2005 express is just
the same: code in header file ;-(
Mauro
 
R

Ronald Laeremans [MSFT]

No changes for Whidbey. We investigated changing this, but it turns out the
single file assumption is baked very deeply in the architecture of the
designers. We are looking ways to change it in future releases, but it will
be far from trivial.

Ronald Laeremans
Visual C++ team
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top