471,321 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

how to add a component


I was working on this walkthrough
(http://msdn.microsoft.com/en-us/library/48cfdff6.aspx) when I came to the
part that says: To create the Calculator component. I found the Project
menu, but I couldn't find the menu item to add a component. Does it mean to
add a class and then to select the component class?
--

Daniel

Aug 2 '08 #1
7 1707
In that same walkthrough, at the part that says: To add public variables to
the Calculator component. Where do I add the lines of code? I mean, within
which set of curly braces, or do I add the code outside of it. The
explanation was not clear.

--

Daniel

"Daniel" <fa*******@falsedomain.netwrote in message
news:A1**********************************@microsof t.com...
>
I was working on this walkthrough
(http://msdn.microsoft.com/en-us/library/48cfdff6.aspx) when I came to the
part that says: To create the Calculator component. I found the Project
menu, but I couldn't find the menu item to add a component. Does it mean
to
add a class and then to select the component class?
--

Daniel
Aug 2 '08 #2
On Sat, 02 Aug 2008 12:57:45 -0700, Daniel <fa*******@falsedomain.net>
wrote:
I was working on this walkthrough
(http://msdn.microsoft.com/en-us/library/48cfdff6.aspx) when I came to
the
part that says: To create the Calculator component. I found the Project
menu, but I couldn't find the menu item to add a component. Does it
mean to
add a class and then to select the component class?
No, it means what it says.

What version of VS are you using? In both VS2005 and VS2008, there is an
"Add Component..." menu item in the "Project" menu. The Express versions
should be the same, but I don't have any installed right now so I can't
verify that.

Pete

Aug 2 '08 #3
On Sat, 02 Aug 2008 13:05:28 -0700, Daniel <fa*******@falsedomain.net>
wrote:
In that same walkthrough, at the part that says: To add public variables
to the Calculator component. Where do I add the lines of code? I mean,
within which set of curly braces, or do I add the code outside of it.
The explanation was not clear.
IMHO, the fact that the sample uses public fields in the class makes me
question just how good a sample it is. It ought to be encouraging you to
use properties for public data for the class.

That said, all members of a class _must_ be declared just like any other:
just within the curly braces surrounding the class declaration.

You will run into the same question for any instruction to add something
to a class, and the answer will always be the same.

Pete
Aug 2 '08 #4
What version of VS are you using? In both VS2005 and VS2008, there is an
"Add Component..." menu item in the "Project" menu. The Express versions
I'm using VS 2008. I don't mean to be argumentative, but I don't see the
"Add Component" menu item. I wonder if I missed something in a previous
step. Do I have to have something selected while I look in the Project
Menu? It refers to the Project Menu at the top of the IDE, not the context
menu right?

Daniel
Aug 3 '08 #5
Perhaps I should show the resulting file. This is the file that is
generated when I add a class of type Component Class to the project. I
already added the lines of code the walkthrough told me to. They all begin
with public... I get errors when I do a build. Does this at least look
like I added a component like I was told to?

--

Daniel

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Sat, 02 Aug 2008 12:57:45 -0700, Daniel <fa*******@falsedomain.net>
wrote:
>I was working on this walkthrough
(http://msdn.microsoft.com/en-us/library/48cfdff6.aspx) when I came to
the
part that says: To create the Calculator component. I found the Project
menu, but I couldn't find the menu item to add a component. Does it
mean to
add a class and then to select the component class?

No, it means what it says.

What version of VS are you using? In both VS2005 and VS2008, there is an
"Add Component..." menu item in the "Project" menu. The Express versions
should be the same, but I don't have any installed right now so I can't
verify that.

Pete
Aug 3 '08 #6
On Sat, 02 Aug 2008 17:14:18 -0700, Daniel <fa*******@falsedomain.net>
wrote:
Perhaps I should show the resulting file. This is the file that is
generated when I add a class of type Component Class to the project. I
already added the lines of code the walkthrough told me to. They all
begin
with public... I get errors when I do a build. Does this at least look
like I added a component like I was told to?
From the file you posted, it seems possible that you've created a project
of the wrong language type. There are no .h files in C#, so if you added
something to your project that generated a .h file, it seems to me your
project probably isn't a C# project.

Maybe you just need to start from the beginning again, and make sure you
follow the instructions exactly, including any implicit requirements.
They don't seem to explicitly state you need to create a C# project, but
IMHO that's implied in the title of the walkthrough.

Pete
Aug 3 '08 #7
I figured out the problem. I created a C++ Windows Forms Application
project instead of a C# Windows Forms Application. Thanks for your help
nontheless.

--

Daniel

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Sat, 02 Aug 2008 12:57:45 -0700, Daniel <fa*******@falsedomain.net>
wrote:
>I was working on this walkthrough
(http://msdn.microsoft.com/en-us/library/48cfdff6.aspx) when I came to
the
part that says: To create the Calculator component. I found the Project
menu, but I couldn't find the menu item to add a component. Does it
mean to
add a class and then to select the component class?

No, it means what it says.

What version of VS are you using? In both VS2005 and VS2008, there is an
"Add Component..." menu item in the "Project" menu. The Express versions
should be the same, but I don't have any installed right now so I can't
verify that.

Pete
Aug 3 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Chien Lau | last post: by
4 posts views Thread by orangepic333 | last post: by
2 posts views Thread by Edward Diener | last post: by
1 post views Thread by Rob Griffiths | last post: by
122 posts views Thread by Edward Diener No Spam | last post: by
7 posts views Thread by Joe | last post: by
11 posts views Thread by BillGatesFan | last post: by
reply views Thread by bharathreddy | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.