Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / August 2007

Tip: Looking for answers? Try searching our database.

header and code files structure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tomb - 16 Aug 2007 13:19 GMT
I had originally posted this to the comp.lang.C++.moderated group, and
was advised to bring this question here.

I haven't used C++ in quite a few years, and that was when I was
learning and made only console applications, but I remember the .h files
only had the function declarations, and the .cpp files had the
implementation.  I just used the project wizard in .net 2003 to
start a new C++ project, .net forms style, and the private events for
the form are only showing up in the .h header file.  ???  In fact, even
the constructor implementation is in the header file.  Is this normal
for forms?  Or has C++ changed?

Based on one of the responses posted in the other group, I was thinking
it may be better to transfer the actual functionality to the .cpp file
and put a function definition in the header, rather than having a bunch
of inline functions in the header to cover the form events.  Does this
sound like the proper approach?

Tom
David Wilkinson - 16 Aug 2007 14:12 GMT
> I had originally posted this to the comp.lang.C++.moderated group, and
> was advised to bring this question here.
[quoted text clipped - 13 lines]
> of inline functions in the header to cover the form events.  Does this
> sound like the proper approach?

Tom:

C++ has not changed. What you see is a weakness of the WinForms class
designer, which is based on the C# one.

I am not an expert on Winforms, but I think it is possible (even
advisable) to move all the code except the InitializeComponent() method
to the .cpp file.

Signature

David Wilkinson
Visual C++ MVP

tomb - 16 Aug 2007 14:46 GMT
>> I had originally posted this to the comp.lang.C++.moderated group, and
>> was advised to bring this question here.
[quoted text clipped - 22 lines]
> advisable) to move all the code except the InitializeComponent() method
> to the .cpp file.

Thanks, David.  That's what I was thinking, so if you're thinking that
way also, then that's what I'll do.  It just makes more sense to me.

T

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.