|
-
February 6th, 2006, 01:38 PM
#1
Where to place the initialization code in VC++.net?
Is it a constructor or a function called InitializeComponent? Also would you please explain why? Thank you very much!
-
February 7th, 2006, 12:38 AM
#2
Re: Where to place the initialization code in VC++.net?
You put initialisation code for non-UI classes in the constructor.
You shouldn't be editing the InitializeComponent part of any control as this is VC++ generated : you'll more likely than not either muck up the designer view or lose your code the next time you edit the control.
If you're talking about a form you have the Load event, which I'd recommend. You can override the OnLoad virtual protected method in your derived form class and do your initialisation in there.
Darwen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|