> 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
[quoted text clipped - 3 lines]
> 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.

Signature
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
Bruce - 23 Dec 2006 12:33 GMT
> 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.
Thank you very much for the clarification. I have been programming in
c++ for years but fairly new to DotNet. I knew the reasons to use CPP
files. I just thought I had missed something new after seeing so many
DotNet samples in the header file.
Bruce