|
-
Feb 15th, 2006, 07:13 PM
#1
Thread Starter
Fanatic Member
How to declare my dll?
Hello,
I want to build a dll and I want the developer who uses it not to be able
to create an instance from this dll.
The dll will have a few members, a few public methods and a few private
methods.
My question is, how should all of these be declared? as abstract? as static?
how should the class be declared?
thanks!
-
Feb 15th, 2006, 07:31 PM
#2
Re: How to declare my dll?
So you have a DLL and you don't want anyone but you to be able to access the classes inside? If so, you could pass some sort of encryption key to the class' constructor to verify. Other than that I'm not sure.
There may be a more elegant way...
-
Feb 15th, 2006, 08:21 PM
#3
Re: How to declare my dll?
It sounds to me like you need to declare the class(es) as sealed with the only constructor(s) declared private, then declare all members as static. If a class has no public constructors then you cannot instantiate it directly. If a class is sealed then you cannot inherit it to add a public constructor. If all members are declared static then you can access those members without an instance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|