Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Re Usable components

Reply
 
Old 06-05-2008   #1 (permalink)
Pure Heart


 
 

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

My System SpecsSystem Spec
Old 06-05-2008   #2 (permalink)
Marc Gravell


 
 

Re: Re Usable components

>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
My System SpecsSystem Spec
Old 06-05-2008   #3 (permalink)
Pure Heart


 
 

Re: Re Usable components

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:
Quote:
Quote:

> >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
>
My System SpecsSystem Spec
Old 06-05-2008   #4 (permalink)
Marc Gravell


 
 

Re: Re Usable components

> 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
My System SpecsSystem Spec
Old 06-05-2008   #5 (permalink)
Pure Heart


 
 

Re: Re Usable components

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:
Quote:
Quote:

> > 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
>
My System SpecsSystem Spec
Old 06-05-2008   #6 (permalink)
Marc Gravell


 
 

Re: Re Usable components

> 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
My System SpecsSystem Spec
Old 06-05-2008   #7 (permalink)
Pure Heart


 
 

Re: Re Usable components

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:
Quote:
Quote:

> > 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
>
My System SpecsSystem Spec
Old 06-06-2008   #8 (permalink)
Marc Gravell


 
 

Re: Re Usable components

> public class
Quote:

>
> 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
My System SpecsSystem Spec
Old 06-06-2008   #9 (permalink)
Marc Gravell


 
 

Re: Re Usable components

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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
No usable video from DVDs Vista music pictures video
Usable on 800 x 600? Live Mail
making the WLM interface more usable Live Mail
Pre SP Product key usable with SP1 new install ??? Vista General
Deleted files still usable by app Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46