C++/CLI Win Forms

My C/C++ skill are out dated and I have no Windows GUI/API experience. So I decided to give VS2015 Windows Forms a go. I worked through a couple online tutorials no issues. But I have a nagging question.

Why does double clicking on a button or menu item drop me into the *.h file? Long time ago the header file was for user data types, structures user defined variables, and the *.cpp file was for code.

Just curious!


In WinForms application it is common practice to write all your code of a class in the header file. In native C++ you keep your code in a .cpp file so you can compile it separately - in a .lib or .dll or .obj file so you don't have to distribute the source code. In C++ .NET a.k.a. CPP/CLI everything goes in one compiled assembly.

Long time ago the header file was for user data types, structures user defined variables, and the *.cpp file was for code.

It is still so, but only in native C++ code.
Topic archived. No new replies allowed.