Why should I code in header file [VS VC++ 2005]

Why should I code in header file [VS VC++ 2005]

Post by Shil » Sun, 05 Feb 2006 13:18:30


In VC++.Net 2005 visual studio, if I create a new winform drag and drop

a button, then double click it to write click event code, then it auto
generates the template code for the event in Form1.h file rather than
Form1.cpp file. This behaviour is against standard C++ coding
standards, where my header file is supposed to just have declarations.
I read in other topics that this is due to C# association of single
file concept with the winform.

Can someone (from MS or MS experts) explain why is this done? and how
can I avoid it to generate template code in header file and write my
code in .cpp file?

Thanks and Regards,

1. Why should I code in header file [VS VC++ 2005]

2. Code in header file in VS 2005 CLR Windows Forms Application

In a VS 2005 CLR Windows Forms Application, code has to be written in
the header file (form1.h per default), in contrast to usual C++
practice. I heard a rumour that this problem will be fixed in a future
version of Visual C++ (Service Pack 1 or the next version of Visual

In addition, I heard that future versions of Visual C++ will allow
"partial classes" .

Can anybody tell me whether these rumours are true? Does anybody know
more details?

Richard Kaiser

3. Why should I code in header file [Visual studio C++ 2005]?

4. Why should I write code in header file in VC++.Net winforms?

5. why is VC++ 2005 so much slower than VC++ 2003 ?

6. active X controls: VC++ 5 vs. VC++ 2005

7. STL list code fires assertion in VC++ 2005, but not in VC++ 2003.

8. Problem with old code, works under VC++ 6 but not VC 2005.

9. VC++ 2005 Express Beta 2 & DirectX 9 Header Files

10. Posting VS 2005 RC code to VS 2005 Beta 2 site

11. clr vs.net 2005 sql 2005 vc++ in vsnet.ide

12. clr vs.net 2005 sql 2005 vc++

13. Large pdb file size with VS 2005; VC++ 8

14. Manifest, VC 6 vs 2003 vs 2005?

15. Why won't this 2003 DTS code compile in VS 2005