Which template should I use for classes

J

Juliano.net

I'm developing a program that I want to be Object Oriented, so I've
opened the Add New File dialog, and there I found "Component Class" and
"Installer Class", which of them should I use to create the classes for
my program logic?
 
B

Bruno van Dooren

Juliano.net said:
I'm developing a program that I want to be Object Oriented, so I've
opened the Add New File dialog, and there I found "Component Class" and
"Installer Class", which of them should I use to create the classes for
my program logic?

none of those for a simple class.
select 'add class' then select the C++ tab and add a C++ class. you can
choose between Managed (.NET) and plain C++.
that will generate the header and source files for your class.

if you are using 'add new file' you can add a new header file and cpp file
and then create the class declaration and implementation yourself, but the
end result will be the same. I just mention this to show that there is
nothing inherently different between adding a class manually and using the
wizard.


--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
B

Ben Voigt

Bruno van Dooren said:
none of those for a simple class.
select 'add class' then select the C++ tab and add a C++ class. you can
choose between Managed (.NET) and plain C++.
that will generate the header and source files for your class.

That's what I do as well, however going the "Component Class" route doesn't
add much extra code at all (about 6 lines) and it lets you add the resulting
class to your forms and set the properties and event handlers using the
designer... so you may consider that for public classes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top