Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use an ActiveX dll to store program data

Status
Not open for further replies.

Griffinator

Programmer
Dec 30, 2002
28
0
0
CA
Hi,

I am looking to use an ActiveX dll to store information about my program such as whether or not the program is a Trial version, if it has been activated, the date it was first run, and the date it was last run. I realize that there has been much discussion in this forum regarding securing your application in this manner, but I feel for my purposes that this will suit my needs.

The question I have is this:

How do I create reference to this dll within my application, and update the information contained within it as needed? For example, if the application is a Trial version, I want to be able to update the value of the date first run contained within the dll and have the dll remember that value. This value will be subsequently checked each time the application is run thereafter until the product has been activated.

Any ideas / suggestions on how to get started on this would be appreciated as I am new to the concept of creating / using dll files.

Thanks in advance!
 
Never mind, after a little poking around I have come to the conclusion that I cannot do what I want with a dll file.

If I am wrong on this, please let me know

Thanks anyways!
 
No, I think you can, actually. If you create a class with a readonly property called IsTrial, let's say, and also a readonly property called FirstRunDate and so on, you can hardcode those values, and have your app instantiate the class and check the properties. What I'm not sure you can do is alter the hard coded value from a runtime context, so if you want to write a new value for the date based on when the user fires up the app, you'd have to write it either to disk somewhere or to some obscure part of the registry.

Bob
 
Hi BobRodes,

Thanks for your suggestion. Like you had mentioned, I do not believe that the values I need to update can be altered and stored at runtime, short of recompiling the dll file on the fly and replacing the existing one.

So, in the end I decided to use an obscure part of the registry with encrypted key values for the data that I need to store. The application then reads and updates these values as necessary.

Thanks anyways!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top