Providing selective access to a VB 6.0 ActiveX DLL

I have an ActiveX DLL that I want to distribute with my application, but I don't want people to be able to use its exposed (public) methods.  Is there a way I can determine from within the ActiveX DLL which Windows program called it, and if the calling program is one of my programs to allow the call but to disregard it otherwise?  

I thought about having my programs just send a secret code to activate the DLL.  Problem is someone could just use my program to activate it, and then make calls to the DLL themselves if I don't have a way of detecting which program is making each individual call.

Thanks for any suggestions!
scottwb_98Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shiju SasidharanAssoc Project ManagerCommented:
hi

Set one of the Propery of ur ActiveX Dll as "SecretCode" and in ur coding u fill ur secret code to the property "SecretCode"
and with in Dll for every function and sub routine make a checking whether this SecretCode Property is filled with correct data and proceed only if it is correct

i hope u got the idea

;-)
Shiju
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rajaloysiousCommented:
I guess COM does'nt have any ability to disregard specific calling programs.

But you can always use methods like this mentioned by shijusn.

Cheers
0
brianb99999Commented:
I thought about having my programs just send a secret code to activate the DLL.  Problem is someone could just use my program to activate it, and then make calls to the DLL themselves if I don't have a way of detecting which program is making each individual call.

In the functions/procedures that are public, pass a 'secret code', this way the code needs to be passed and verified everytime the function/procedure is called.  This will avoid the 'Problem is someone could just use my program to activate it, and then make calls to the DLL themselves' problem.

ie
public somesub(secretcode as string)
  if secretcode = "xyz" then
    msgbox "access granted"
    ...
  else
    msgbox "go away"
  end if

Brian.
0
scottwb_98Author Commented:
Only problem is someone could theoretically create their own DLL using the same function names and parameters, and use that to capture the password.  That would render the password effectively useless.  This is why I was thinking detecting which program is calling the DLL would be the best method...
0
brianb99999Commented:
This is why I was thinking detecting which program is calling the DLL would be the best method...
Hmmm, although I am sure there would be a way to do this, I have not needed to.  But what about hiding an entry in the registry whenever your program calls the .dll (removing it straight after the call) and detecting the reg entry?  As long as the reg entry is the first thing the .DLL looks for it should work.

Brian.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.