License Visual C++ Applications
In This Topic
There is an issue in VC++ 2019, where the license file is ignored during the build process; therefore, the licensing information is not included in VC++ applications. Additionally, the licensing code cannot generate a resource for the entry application. In this case, we need lookup the plugin license from an assembly in current app domain.
To properly license WinForms and WPF controls referenced from a VC++ project, extra steps must be taken to generates the runtime license.
If you are referencing WinForms or WPF controls version 2020 v2 (x.x.20202.xxx) or later, follow these steps:
- Open the MESCIUS License Manager from the Visual Studio tools menu.
- Select Create RunTime License
- Select the WinForms or WPF module that is referencing the ComponentOne controls
- Click Generate. This will generates a unique runtime license (.gclicx) that must be compiled as an embedded resource within this module.
- Rebuild the application to include the runtime license in the application.
If you are referencing WinForms or WPF controls older than 2020 v2 (x.x.20202.xxx), follow these steps:
- Build the C++ project as usual. This should create an .exe file and also a licenses.licx file with licensing information in it.
- Copy the licenses.licx file from the app directory to the target folder (Debug or Release).
- Copy the lc.exe utility and the licensed dlls to the target folder.
- Use lc.exe to compile the licenses.licx file. The command line should look like this:
lc /target:MyApp.exe /complist:licenses.licx /i:C1.Win.C1FlexGrid.dll
- Link the licenses into the project. To do this, go back to Visual Studio, right-click the project, select Properties, and go to the Linker/Command Line option. Enter the following:
/ASSEMBLYRESOURCE:Debug\MyApp.exe.licenses
- Rebuild the executable to include the licensing information in the application.