473,372 Members | 1,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 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 1781
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Chien Lau | last post by:
I had a situation occur today that's happened a number of times before and I'd like to get your take on it: Imagine... You're developing a WinForms app for a client that includes the use charts....
4
by: orangepic333 | last post by:
Could someone tell me what's the difference between the two? Is it that a class is used within an OO language while a component can be exported between OO languages? Are there other...
2
by: Edward Diener | last post by:
How does one specify in a component that a property is a pointer to another component ? How is this different from a property that is actually an embedded component ? Finally how is one notified in...
0
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
7
by: Joe | last post by:
Is it possible to have a component which is global to the entire application? I need to have a single component act sort of like a server which components in any of the forms can access. For...
11
by: BillGatesFan | last post by:
I have a web service which calls a .NET queued serviced component in COM+. I turned statistics on for the component. I call the component 10 times, 10 objects get created but they do not go away....
0
by: bharathreddy | last post by:
In .Net COM+ components are referred to as serviced components, Namespace: System.EnterpriseServices; Advantage of Serviced Components: object pooling, database connection pooling,
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.