I have seen sample code that is implemented in the .h header file ("java
style") and I have seen samples where the code was implemented in the .CPP
file. Which is correct? What is the best place to put my code
implementation in VC++ DotNet?
P.S. The code is for a control where I am only going to distribute the
DotNet DLL.
Whenever possible, your code implementation should be in the cpp file, and
the declaration in the h file.
exceptions:
- template classes should go into the h file completely because there is no
other option.
- IDE generated classes like Window Forms classes. These are implemented in
h files because the wizard does not understand the concept of difference
between declaration and implementation.
The reasons for the split is that a change in the h file causes a
recompilation in all the cpp files that include it. you want to prevent as
much as possible.
It is also the worldwide standard to program this way,
And finally, If you build libraries you have to have a separate header file
with the declarations anyway.
--
Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"