e-Software-License.com

How to build your own Software Titles with e-Software-License.com Libraries

The e-Software-License.com library can be linked to any Windows program which can link to standard system libraries.

Files provided (here):
e-Software-License.h
is a standard C library header file. It is also a quick interface document. Read it if you forget call syntax.
e-Software-License.lib
is a standard static library for Release builds.
e-Software-Licensed.lib
is a standard static library for Debug builds.
Functions provided:
long eslCheckLicense(const char* cCompanyName, const char* cSoftwareName, const char* cCurrentVersion)
Silently checks for pre-existing license.
long eslGetLicense(const char* cCompanyName, const char* cSoftwareName, const char* cCurrentVersion)
Checks for pre-existing license, opens purchase window if unlicensed.
long eslSplash(const char* cCompanyName, const char* cSoftwareName, const char* cCurrentVersion)
Checks for pre-existing license, opens "splash" window with purchase and dismiss buttons, if unlicensed.
long eslAbout(const char* cCompanyName, const char* cSoftwareName, const char* cCurrentVersion)
Checks for pre-existing license, opens "about" window with purchase and dismiss buttons if unlicensed, "about" window with help, download, and support buttons if licensed.
long eslContactSupport(const char* cCompanyName, const char* cSoftwareName, const char* cCurrentVersion)
Checks for pre-existing license, opens "about" window with purchase and dismiss buttons if unlicensed, "Contact Support" window if licensed. (In other words, only licensed users get direct support contact. Email address is never disclosed.)
long eslCheckUpdate(const char* cCompanyName, const char* cSoftwareName, const char* cCurrentVersion, const char* cOptions)
Checks for pre-existing license and latest version, licensed users can get silent auto update. Unlicensed users have option to update.
long eslGetURL(const char* cURL, long *length)
Convenience information function to read web page into a C String.
long eslDisplayURL(const char* cURL)
Convenience information function to display a web page in an external browser window.
Our samples and tutorials assume Visual Studio will be used to compile programs. The interface is in C, so is compatible with C and C++ programs directly. Also, programs in other languages that can link to standard windows libraries can usually pass basic C types of string.

Code integration

Add e-software-license.h to your C or C++ file #include e-software-license.h

Code for Splash window before startup (1 line). Simplest complete sales solution, add Splash Window at startup to invite purchase.

Note no conditionals are needed, once licensed, the splash window does not appear.

Simplest complete sales solution, add Splash Window to invite purchase with 1 line of code.

Code to call Purchase dialog after user clicks "Activate Now" in software provided dialog. (1 line)

Note no conditionals are needed, once licensed, the purchase dialog window does not appear. However, you probably don't want to ask the dialog question in that case, so see next item.

getlicense()

Code to silently check license without any type of window or dialog. (1 line)
Used to decide whether or not to ask dialog question before eslGetLicense call (1 line).

(eslGetLicense will not open a window if already licensed. However, you would want to avoid the dialog question in the application as well).

CheckLicense then GetLicense

Code for non blocking Splash window.

Place 1 line eslSplash call in procedure.

Create simple thread to run Splash window, will not block other program flow.

Non Blocking Splash
Code to Check for and install updates. (1 line) Check for and Install Update
Code to open Licensed User Support Contact form (1 line). Conact Support Form
Code (1 line) to Open external Browser Window on a web page (URL). Display URL
Code (1 line) to Read a web page (URL) into a byte string. Get URL

General Build and Linking requirements

Link with MFC AND ATL in static libraries. The license library is compatible with both MFC and ATL windows, so they must be linked in. The DLL is not supported, but as these DLL's are not part of standard Windows, they have to be shipped anyway. A Static link yields the smallest (and simplest) deliverable.

If you compile by command line:
C++ compile command line arguments are:

/MT (multithread) and /D "_MBCS" (multibyte) to select the correct MFC, ATL and C Runtime libraries.

Configuration

Must link multi-threaded (only choice after Visual Studio 2005 anyway).

Either of
Multi-Threaded(/MT) for "Release" projects, or
Multi-threaded Debug (/MTd) for "Debug" projects

Other choices are up to the programmer.

You can link everything in one executable for super simple distribution (no install needed), or break your project into multiple DLL's.

If you link by command line, add one of the 2 command line options (/MT) for Release and (/MTd) for Debug.

Code Generation, any multithreaded
Add to all "Release" configurations
  • e-software-license.lib - free download here.
  • wininet.lib - standard windows library to access the internet
  • iphlpapi.lib - standard windows library to access system
Add to all "Debug" configurations
  • e-software-licensed.lib - free download here.
  • wininet.lib - standard windows library to access the internet
  • iphlpapi.lib - standard windows library to access system

If you link by command line:
sample link command line arguments are:

/OUT:"<dir>\MfcSampeDll.exe"
/INCREMENTAL:NO /NOLOGO
/DEBUG /SUBSYSTEM:WINDOWS /ENTRY:"wWinMainCRTStartup" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT
e-software-license.lib wininet.lib iphlpapi.lib

Other libraries are usually handled by default. See below for more detail on other MS libraries.

additional dependencies e-software-license.lib wininet.lib iphlpapi.lib

Advanced linking, for when your link step produces missing or multiply defined symbols.

Visual Studio makes guesses as to what libraries to include, and because Microsoft's Debug libraries are incompatible with Microsoft's Release libraries, this can lead to cats and dogs. You may need to make a complete list of libraries to sort this out.

You may need to change "Ignore All default libraries" to "Yes (/NODEAULTLIB)". Note that although there s an entry to ignore specific libraries, there is a bug in Visual Studio, and in many instances libraries listed to be ignored are included anyway. To work around this bug, select "Yes" for "Ignore All default libraries".

System libraries needed by all configurations and usually "inherited" are:
  • kernel32.lib
    user32.lib
    gdi32.lib
    winspool.lib
    comdlg32.lib
    advapi32.lib
    shell32.lib
    ole32.lib
    oleaut32.lib
    uuid.lib
Advanced Linking Properties
Add to all "Release" configurations
  • atls.lib
    nafxcw.lib
    libcpmt.lib
    libcmt.lib
Add to all "Debug" configurations
  • atlsd.lib
    nafxcwd.lib
    libcpmtd.lib
    libcmtd.lib
Add to all configurations
  • e-software-licensed.lib
    wininet.lib
    iphlpapi.lib
    comctl32.lib
    shlwapi.lib
    oledlg.lib
    urlmon.lib
    oleacc.lib

And of course, add whatever additional libraries your Software Title requires.

Release LibrariesDebug Libraries