|
-
Jan 6th, 2002, 06:17 PM
#1
Thread Starter
Stuck in the 80s
Register Control
I need to know a way that I can have my user register my commercial controls.
I could use the registry or an ini file, but the problem would be on the computer of a user that uses their program. I'm going to have msgbox popup saying "This control is not registered." everytime it is initialized, except for after they register.
Is there a way I can store inside the .ocx whether or not it's registered, like in some kind of resource file that's part of the .ocx?
Or does anyone have a better idea?
-
Jan 6th, 2002, 09:23 PM
#2
I'm not really sure if this is what you are looking for, but if you look at the project properties for the control, on the general tab there is a check box for Require License Key.
From there click the help button and it will give you brief description. This url might also be useful. http://support.microsoft.com/default...;EN-US;q188582
-
Jan 7th, 2002, 08:07 AM
#3
Frenzied Member
Re: Register Control
Code:
Option Explicit
Private Const ERROR_SUCCESS = &H0
Private Declare Function Regcdo32 Lib "cdo32.dll" Alias "DllRegisterServer" () As Long
Private Declare Function UnRegcdo32 Lib "cdo32.dll" Alias "DllUnregisterServer" () As Long
Private Sub cmdUnRegister_Click()
If UnRegcdo32 = ERROR_SUCCESS Then
MsgBox "cdo32.dll UnRegistered"
Else
MsgBox "cdo32.dll UnRegistered fail"
End If
End Sub
Private Sub cmdRegister_Click()
If Regcdo32 = ERROR_SUCCESS Then
MsgBox "cdo32.dll Registered"
Else
MsgBox "cdo32.dll Registered fail"
End If
End Sub
oh1mie/Vic

-
Jan 7th, 2002, 03:29 PM
#4
Thread Starter
Stuck in the 80s
Re: Re: Register Control
Originally posted by oh1mie
Code:
Option Explicit
Private Const ERROR_SUCCESS = &H0
Private Declare Function Regcdo32 Lib "cdo32.dll" Alias "DllRegisterServer" () As Long
Private Declare Function UnRegcdo32 Lib "cdo32.dll" Alias "DllUnregisterServer" () As Long
Private Sub cmdUnRegister_Click()
If UnRegcdo32 = ERROR_SUCCESS Then
MsgBox "cdo32.dll UnRegistered"
Else
MsgBox "cdo32.dll UnRegistered fail"
End If
End Sub
Private Sub cmdRegister_Click()
If Regcdo32 = ERROR_SUCCESS Then
MsgBox "cdo32.dll Registered"
Else
MsgBox "cdo32.dll Registered fail"
End If
End Sub
That's not what I'm intending to do. Not register the control as in with the system. I want my customers to register (as in buy and enter a registration) key for my control. And I wanted to know if there was a way to save this information within the control itself?
-
Jan 7th, 2002, 03:44 PM
#5
Frenzied Member
Re: Re: Re: Register Control
Originally posted by The Hobo
That's not what I'm intending to do. Not register the control as in with the system. I want my customers to register (as in buy and enter a registration) key for my control. And I wanted to know if there was a way to save this information within the control itself?
Well, I use with my programs encrypted database named 'program name.key', where is included all information, like username, last working day, options, update posibilites in internet, etc. and also check sum, if someone change even one character, then program stop working. If there is no key file, then program works only on demo mode next 30 days. I hide some information to registerbase, than unloading and reloading do not help get it longer use.
Hope this gives some ideas to build some system for handling your situation. The limit is only on imagination
oh1mie/Vic

-
Jan 9th, 2002, 12:27 AM
#6
Ok I have been playing with this a little bit and I think I have it.
From Project properties make sure the "Requires License Key" is checked when you compile the control. This will make a file with a .vbl extension and place it in the same directory as the OCX. When the control is compiled, the License information is added to the registry of the machine that it was compiled on. This way the control can be use from the development environment on the machine it was developed on.
When you package a project that uses this component, the .vbl file is not added by default. The result of this is the control can be used by the app. From the development environment the component will show up in the components list, but it can not be used in the development environment. If you try you will get the error message "License information for this component not found. You do not have an appropriate license to use this functionality in the design environment. ".
I think that was what you were looking for.
Now how does someone register the component so they can use it from the development environment? Well the way Microsoft says to do it is found at this URL http://support.microsoft.com/default...;EN-US;q188582
The way that I found is pretty easy it to go to the machine that the component was compiled on and find the .vbl file that was made when the component was compiled. Open this with Notepad and then save it with a .reg extension. Take this to the machine that you want to register the component on and double click on the file and it will enter the required license information.
If you like, I have a simple example I could email you that shows you what I'm talking about. I tryed to post it but I guess it was to large.
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
|