Desaware Home
Products    Purchase    Publishing    Articles   Support    Company    Contact    
Product FAQ
Licensing System
CC Factory
Event Log Toolkit
IniFile Tool-5M
NT Service Toolkit
OneTime Download
VBX Legacy
Professional Services


Contact Desaware and order today

Sign up for Desaware's Newsletter for the latest news and tech tips.

NT Service Toolkit Support

NT Service Toolkit FAQ - Embedded Licensing

How do I license the dwSock6 and dwbkthrd components to run as part of my  components?

The dwsock6.dll and dwbkthrd.dll components have built in licensing that require that a license file be present in order for the component to run within the Visual Basic environment. This poses no problem when using the component with applications or ActiveX EXE servers. However, it can present a problem if you wish to use these components within your own ActiveX DLLs, ActiveX controls or ActiveX Document DLLs. When the end-user tries to load your component within Visual Basic, even though your control may be licensed, the dwsock6.dll and dwbkthrd.dll components detect that they are running within Visual Basic and raise a licensing error.

In order to allow you to use these components within your own components, Desaware introduces a license key scheme that will allow you to enable the component to run even when the required license file is not present. This scheme requires only a few lines of code in your component. Naturally, there is no cost or royalty fees for you to use this mechanism. However, we do remind you that under the terms of the SpyWorks license, you may only distribute our components when your component adds significant and primary functionality. In other words, you can't use it to ship your own general purpose winsock or background thread component. This is similar to the license terms that Microsoft and other companies use in cases like this ? for example: Microsoft does not allow you to use the JET redistributable components to implement your own general purpose database product. If you have any questions, don't hesitate to contact us.

The following demonstrates how to use the License Key with dwsock6.dll.

The dwsock6 component includes a class called "dwRedistributable". This class contains a single method called "IsLicensed". When you call this function with a valid license key, the dwsock6 component will be enabled for use with your component. You must create a dwRedistributable object and call the IsLicensed method before you attempt to create any other objects in the dwsock6 library.

The following code shows how you might enable licensing for redistribution for an imaginary component named desaware.dll that uses the dwSock6.dll component.

Dim sublicok As Boolean Dim EnableRedistribution As _
New dwsock6.dwRedistributable 
' Enable the Desaware Winsock component when used 
' with this control (desaware.dll) 
sublicok = EnableRedistribution.IsLicensed( _

The IsLicensed method will return True (non-zero) if the component licensing is enabled for the component. Note that this key will only work to enable licensing when using your compiled component. You'll need the NT Service Toolkit license while designing your control or component.

The following demonstrates how to use the License Key with dwbkthrd.dll.

The dwbkthrd component supports licensing through the EnableComponent method.

The following code shows how you might enable licensing for an imaginary component named BackTutorialDLL2.dll that uses the dwbkthrd.dll component.

Dim backlauncher As dwObjLaunch Set backlauncher = _
New dwObjLaunch 
' License the background thread component to run with 
' BackTutorialDLL2.dll 
backlauncher.EnableComponent _
Set backclass = _

A licensing error #419 (Permission to use object denied) if you attempt to use the dwbkthrd.dll component within the VB environment on an unlicensed system without enabling licensing.

Creating a License Key

You can create a license key for your component using the dwLicGen6.exe program. This program will ask you to enter the compiled name of your component (not including a path, but including an extension). Each key is unique to a component name. If you change your component name, you'll have to create a new license key. After the program generates the key, you will have the option to copy it to the clipboard to past into your application.

Final Notes on Licensing DLLs

You only need to use this license key scheme when distributing in-process components such as ActiveX DLL's, ActiveX Controls or ActiveX document DLL servers. You do NOT need to use this mechanism for standalone applications, ActiveX executables, and ActiveX document EXE servers. They do not run within the Visual Basic environment, thus need no special handling.



Products    Purchase    Articles    Support    Company    Contact
Copyright© 2012 Desaware, Inc. All Rights Reserved.    Privacy Policy