473,769 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exposing properties and methods

How do you make a program's properties and methods availale so that other
programs can "connect" to them at design time and then use them at run time?

Nov 17 '05 #1
3 1263
Just about any assembly you build is capable of being used by another
application. If the project you are building outputs to a class library, all
public classes and public methods (within public classes) will be accessible
to the outside (of the DLL) world.

Once your DLL is built, you need only add a reference from another
application (or library) to use it. One note though, depending on how you
intend your library to be used, you may want to give it a strong name so that
it can be installed in the GAC.

No need to write horrible .def files or define the function in six and a
half places as you would when exposing things from a C++ DLL.

Does that answer your question?

Brendan
"FredC" wrote:
How do you make a program's properties and methods availale so that other
programs can "connect" to them at design time and then use them at run time?

Nov 17 '05 #2
You don't typlically make a _program's_ properties and methods
available to other programs. Usually you put common classes in a DLL,
which is a separate project, and then put that DLL in your "References "
section of projects that want to use those common classes.

In other words, you have to separate the common code from the code
that's specific to your application, and put that common code in a
separate project.

Nov 17 '05 #3
FredC <Fr***@discussi ons.microsoft.c om> wrote:
How do you make a program's properties and methods availale so that other
programs can "connect" to them at design time and then use them at run time?


You need to make them public, and part of a class library. The
"client" programs will then add a reference to your library.

Under the hood, .NET actually lets you refer to executable assemblies,
but VS.NET doesn't.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4

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

Similar topics

0
942
by: MeMyselfNDotnet | last post by:
Hi All, Im facing a problem with the COM+ component, will appreciate if u can provide any kind of guidance. My COM+, references a class, lets call it class A. It uses the properties of Class A, and has methods to return / insert / update / delete etc. I have an Admin module(another dotnet solution), which accesses the COM+ component (via referencing the dll). And uses the methods which are in the COM+.
4
6821
by: Luke Briner | last post by:
My ActiveX Container requires certain properties to be exposed by components - properties that appear under the properties section in the IDL/type library file. C# properties are exposed as methods and the interfaces that my c# class implements cannot contain fields in order to expose these as properties. Can anyone tell me how to expose c# code as COM (IDL) properties. Thanks
8
1919
by: Dave A | last post by:
I have a class called 'PrimaryKey' that represents the primary key of a table. PrimaryKeys can only be created and the class only implements .ToString(). The PrimaryKey class internally stores the data as either a int or a Guid depending on the structure of the database. If we simply used int to represent a primary key, rather than this PrimaryKey class then programmers could do things like performing mathematically operations on the...
0
1247
by: Symon | last post by:
Hi everyone, I'm writing a webservice where I'm trying to expose a framework that contains a number of classes which have read-only properties. I want to expose data-transfer proxies of these objects with both getters and setters and so that all the properties are exposed via the webservice and want to copy all the data to the proxy before sending the data and only copy the data from the proxy where the underlying object's property...
3
2984
by: Dave | last post by:
Please - anyone that can help. I am getting confusing results while trying to expose a collection from a web service. I have a webservice in which a web method accepts a collection as a parameter and returns an array of datasets. The collection consists of database connection objects. Based on the simple hierarchy below, you can see that starting with the
1
1578
by: Adam Clauss | last post by:
First, I have ComVisible set to true for the entire assembly. I have (abstract) base class A. There are interfaces IA and IAEvents for accessing properties of this object and exposing events. [ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(IAEvents)) public abstract class A : IA {
4
7568
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
We have a class that has a public property that is of type List<T>. FXCop generates a DoNotExposeGenericLists error, indicating "System.Collections.Generic.List<Tis a generic collection designed for performance not inheritance and, therefore, does not contain any virtual members. The following generic collections are designed for inheritance and should be exposed instead of System.Collections.Generic.List<T>. *...
2
2209
by: =?Utf-8?B?RGFsZQ==?= | last post by:
I have an app with a MasterPage. In the MasterPage is a user control with several public properties and methods that I want exposed to the content page. Rather than writing several redirection methods to expose the properties, I would rather just expose the user control as a property of the MasterPage. The problem is, when I compile, I get an exception on the content page: The type 'MessageBlock.MessageBlock' is defined in an...
0
1088
by: Michaelp | last post by:
Hello! Seems that PHP gets more and more object oriented, which is good. I am now running a course in PHP, using PHP 5, where we are going to use the DOM interface. I am trying to teach them good OO practices, meaning that we insistently hide properties and expose them as get or set methods. Looking at the PHPs DOM implementation, I see that many of the
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.