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

Why use "Public" with exe projects?

Is there any point to making classes or interfaces public in an EXE
project? Executables can't be referenced by other applications so why
would you ever need public classes?

Do people leave them public simply because that's how VS.NET's code
generator produces them or are there other advantages I'm missing
altogether?

Is it worth it to convert public types to "Friend" (or whatever the C#
equivalent is...) or is that just wasted effort?

Joel Moore
Dec 8 '06 #1
3 1093
In DotNET (2.0 at least), you can reference EXE's just like DLL's.

Kelly

Joel Moore wrote:
Is there any point to making classes or interfaces public in an EXE
project? Executables can't be referenced by other applications so why
would you ever need public classes?

Do people leave them public simply because that's how VS.NET's code
generator produces them or are there other advantages I'm missing
altogether?

Is it worth it to convert public types to "Friend" (or whatever the C#
equivalent is...) or is that just wasted effort?

Joel Moore
Dec 8 '06 #2
Joel Moore <as*******@asdaadad.comwrote:
Is there any point to making classes or interfaces public in an EXE
project? Executables can't be referenced by other applications so why
would you ever need public classes?
Executables can be referenced by other applications. Prior to VS 2005,
one could only do it by manually editing the project file, but it's
certainly possible.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 8 '06 #3
Jon Skeet [C# MVP] <sk***@pobox.comwrote in
news:MP************************@msnews.microsoft.c om:
Joel Moore <as*******@asdaadad.comwrote:
>Is there any point to making classes or interfaces public in an EXE
project? Executables can't be referenced by other applications so why
would you ever need public classes?

Executables can be referenced by other applications. Prior to VS 2005,
one could only do it by manually editing the project file, but it's
certainly possible.
Well I'll be. Thanks.
Dec 8 '06 #4

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

Similar topics

4
by: MLH | last post by:
The following function declaration confuses me... Public Function IsEMailAddress(ByVal sEmail As String, Optional ByRef sReason As String) As Boolean I tried pasting it and its code into an...
4
by: Jon Shemitz | last post by:
Syntax seems to say "modifiers is modifiers" and either is valid, but Google searches seem to show that "public virtual" is more common. Is there any sort of (semi) official convention? -- ...
0
by: VB Programmer | last post by:
I wanted to access some properties of a panel control that is on a different form. So, I went to the (Declarations) section of my main form (the form with the panel) and changed the panel (called...
0
by: Benjamin Lukner | last post by:
Hi! I'd like to dynamically call API functions from different DLLs, depending on what platform the program runs. Now I'm wondering what the most simple way may be (without meta code and compiler...
1
by: timbobd | last post by:
I have encountered a situation that I don't understand. When I call a sub of Friend scope (in an object with Friend scope), I am getting an error "Public member 'subname' not found in type...
0
by: AndyB | last post by:
I'm using xsd.exe to generate a typed-dataset. Then using typed dataset tables (datatables containing two columns--a name and a value) to bind to ASP.NET dropdown list controls (for the dropdown...
2
by: Pardeep Kadian | last post by:
Hi , having as issue , which gives errors like this while linking... error LNK2019: unresolved external symbol "public: __thiscall std::ios_base::Init::Init(void)"...
3
by: jbeteta | last post by:
Hello, I have a problem declaring variables. I need to create an object oRpte as ReportClass on WebForm1.aspx and be able to use its value on WebForm2.aspx. For declaring the property oRpte()...
3
by: Matt | last post by:
Hi everyone, can someone point out the difference between defining a class with the public access modifier and just leaving it as it is (default in vs.net "class") I think that the default...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...
0
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...

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.