473,405 Members | 2,334 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,405 software developers and data experts.

Re Usable components

hi

i want to make classes and components that i can re-use in developing
applications seems that just compiling and adding a referance of the dll to
my projects is not enough to let me use the classes inside them so haw can
that be done ?

and whats the difference between class and component ? i mean what shall i
do with the component user interface since i wont put controls and text boxes
on it ?
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643
Jun 27 '08 #1
8 876
>and adding a referance of the dll to my projects is not enough

It should be... are the classes declared public?
Also - do you mean via code, or via the GUI designer? If the latter you
might need to use the "Choose Items..." option on the toolbox to make
them visible.

Marc
Jun 27 '08 #2
hi

thank you for yor answer but i dont see any relation with my question :)
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643
"Marc Gravell" wrote:
and adding a referance of the dll to my projects is not enough

It should be... are the classes declared public?
Also - do you mean via code, or via the GUI designer? If the latter you
might need to use the "Choose Items..." option on the toolbox to make
them visible.

Marc
Jun 27 '08 #3
thank you for yor answer but i dont see any relation with my question :)

In what sense? You are saying that adding a reference isn't enough...
well, the fact is: it is! If it isn't working, then either the classes
are internal (in which case you need to make them public), or you are
talking about the designer, which has a separate list of what it displays.

If you having a more specific error (i.e. more than you simply can't
find the classes), then post the error!

Marc
Jun 27 '08 #4
i choosed new project then class library type, add some public class and
complied it
to a dll, then added a referance to that dll in another project is that
enough ?
i dont know what you mean by saying making the class public ? i defined it
as public but is there another thing i should do ?
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643
"Marc Gravell" wrote:
thank you for yor answer but i dont see any relation with my question :)

In what sense? You are saying that adding a reference isn't enough...
well, the fact is: it is! If it isn't working, then either the classes
are internal (in which case you need to make them public), or you are
talking about the designer, which has a separate list of what it displays.

If you having a more specific error (i.e. more than you simply can't
find the classes), then post the error!

Marc
Jun 27 '08 #5
i defined it as public

That should be enough. You should now be able to find the class (with
the requisite namespace declarations). For example, the class might be
ClassLibrary1.Class1 - in which case either add "using ClassLibrary1",
or use the explicit ClassLibrary1.Class1 syntax (obviously the names
will vary!).

Marc
Jun 27 '08 #6
you mean just

public class

end class

and thas it cuz that didnt wok with me ?
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643
"Marc Gravell" wrote:
i defined it as public

That should be enough. You should now be able to find the class (with
the requisite namespace declarations). For example, the class might be
ClassLibrary1.Class1 - in which case either add "using ClassLibrary1",
or use the explicit ClassLibrary1.Class1 syntax (obviously the names
will vary!).

Marc
Jun 27 '08 #7
public class
>
end class
No, mainly because that won't compile... but something like

public class Foo {}

should work; then after adding a reference you should be able to use

Foo foo = new Foo();

etc in the second project.

Marc
Jun 27 '08 #8
Oops; just realised this is "dotnet.general", not C#, so ignore the last
comment ;-p

But are you *sure* you are adding the reference?

Marc
Jun 27 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yasutaka Ito | last post by:
Hi, As you know, all the non-ui components (like Timer control, etc.) that sit on the form are contained in its private variable 'components'. How can I enumerate such components from any form...
6
by: Mario T. Lanza | last post by:
Greetings, I don't know about you guys but on many occasions I've asked myself whether or not someone else has solved a particular programming issue -- whether or not they developed a clever...
4
by: james | last post by:
I have a custom UserControl, which can have many sub class levels derived from it. I want to be able to discover all the components at Load time, but the only components I can see from the base...
12
by: Arda Han | last post by:
Hi friends, I need your valuable suggestions for usefull .Net components? Which components are you suggest me? I was try xtragrid it is wonderfull. Tell me please your favourite component...
0
by: petro | last post by:
I am trying to deploy an asp.net application to my web server. My application uses system.data.oledb to connect to an oracle database. On my development machine I have the oracle client 10g...
2
by: ziad dodin | last post by:
I developed a module that converts money amounts into words; this module is essential in all financial applications like cheques, invoices, bills etc. I need to know in detail how to make it...
8
by: JackRazz | last post by:
Is it possible to add an extended property to components like I can with controls via IExtenderProvider? JackRazz
2
by: David Veeneman | last post by:
Is there a way to iterate the components on a form? I need to determine whether an instance of my custom component (a System.ComponentModel component) is present in a form. I have tried...
1
by: ainadeck | last post by:
hello...im using vb 2008 express edition and already registered for the product...i have this problem..i cant create any form because there are usable control in tollbox..then i right click at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.