Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2006

Tip: Looking for answers? Try searching our database.

Allow instantiation internal but not external?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bruce - 26 Nov 2006 18:00 GMT
Is there any way to define a class in such a way that it will allow
instantiation of the class internal to my project but not allow it when
the class is used via the resulting DLL of my project?  In ActiveX this
can be done with the noncreatable keyword.   How can this be done in .Net?

I tried making the constructor protected protected but that did not seem
to work.
Steve Alpert - 26 Nov 2006 19:25 GMT
C# has an "internal" keyword.

> Is there any way to define a class in such a way that it will allow
> instantiation of the class internal to my project but not allow it when
[quoted text clipped - 3 lines]
> I tried making the constructor protected protected but that did not seem
> to work.

/steveA

Signature

Steve Alpert
my email fgrir.nycreg @ tr.pbz is encrypted with ROT13 (www.rot13.org) and spaces

Bruce - 26 Nov 2006 21:37 GMT
> C# has an "internal" keyword.

> /steveA

Thanks,

I tried again and placing all of the constructors under "private public"
does indeed work.  VB's Intellisense allows the new keyword to be used
but throws an error once used.

Bruce

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.