?
Solved

avoid dll from referencing

Posted on 2003-02-19
8
Medium Priority
?
201 Views
Last Modified: 2010-05-18
Hello all,
I am creating an application that interacts with the database via a dll. the dll also has other bussiness logics and encryption of data, implemented.
Since i will be distributing the dll with my application, there arise a need to know how do i avoid/stop my dll from being referenced by other projects.
Like for eg: if one tries reference any dll(pick any one randomly from the system32 folder), it will say "can't add a reference to the specific file". i want something like this, so that my logic remains protected in dll.
Any ways to go about it ??
Have a great day,
happy programming
Bhushan
0
Comment
Question by:bhushanp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 3

Accepted Solution

by:
y2ksw earned 200 total points
ID: 7981100
1) Name it in a very specific way, not common to the 8.3 standard of most DLL's. No protection against other uses.

2) Put in the Class_Initialize event a procedure which goes and read a specific value from the registryor a specific file. If this is missing, do an Err.Raise 12345, for example, and the DLL cannot be loaded. This requires an installation procedure first. But this isn't standard programming and not very kindly to potentional new clients who'd like to look at your DLL's interface.

3) Insert an Init procedure and pass some parameters for activating the DLL functions. So people can develop with the DLL interface but cannot run the code. This way is ISO and used widely.

4) Use a software protector (like ASProtect) ==> professional protection, but some extra expenses and programming requirements.

Hope this helped :-)
0
 
LVL 1

Expert Comment

by:HarmnKardn
ID: 7982545
If you want to be an uber-bastard, you could require all your client's computers to have net access, and the client developer machine make a socket connection with a simple registration server you write and admin yourself.  

You'll be able to monitor everyone who instantiates your COM objects online, even implement some form of authentication to let some users make some objects, other users no objects, etc.

However, this approach is painful and impractical.  Instead I'd recommend y2ksw's solution number 3) (the Init procedure).
0
 
LVL 7

Expert Comment

by:webJose
ID: 7990069
Just a note:  The specifics of "can't add a reference to the specific file" refer to the fact that the dll selected does not contain a valid type library embedded.  That is all.

As for your problem, I also vote for option 3) above, although you can always make the dll require licensing.  But again, I think VB is not capable of making use of runtime-only licensed dlls because it does not compile the license key for this particular type of COM houses.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bhushanp
ID: 7998124
Hello all,
i worked on the option no. 3 posted by y2ksw and it worked just well as i needed.
Thanks for your response.
Bye
Best regards
Bhushan
0
 

Author Comment

by:bhushanp
ID: 7998387
Hello all,
i worked on the option no. 3 posted by y2ksw and it worked just well as i needed.
Thanks for your response.
Bye
Best regards
Bhushan
0
 

Expert Comment

by:CleanupPing
ID: 8940468
bhushanp:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 3

Expert Comment

by:y2ksw
ID: 8942037
> Who deserves points here?

Me :-)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8959631
Moderator, my recommended disposition is:

    Accept y2ksw's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question