Results 1 to 3 of 3

Thread: How to declare my dll?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849

    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!

    Dekel C.

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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...
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width