DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 16 Aug 2007 08:19:55 -0400,    posted on: microsoft.public.dotnet.languages.vc        back       

Thread Index
  1    tomb
          2    David Wilkinson
                 3    tomb


header and code files structure   
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
Date:Thu, 16 Aug 2007 08:19:55 -0400   Author:  

Re: header and code files structure   
tomb wrote:

> 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:

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.

-- 
David Wilkinson
Visual C++ MVP
Date:Thu, 16 Aug 2007 09:12:09 -0400   Author:  

Re: header and code files structure   
David Wilkinson wrote:

> tomb wrote:
>> 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:
> 
> 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.
> 

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
Date:Thu, 16 Aug 2007 09:46:28 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us