joadwe
July 28, 2021, 1:59pm
#1
Using the C library LexActivator.h from MATLAB what input arguments are needed to obtain the license key?
Currently using:
sSharedLibrary = ‘LexActivator’;
loadlibrary(sSharedLibrary,@LexActivatorPrototype )
[valid] = calllib(sSharedLibrary,‘IsLicenseGenuine’)
[output] = calllib(sSharedLibrary,‘GetLicenseKey’)
and receiving the error:
No method with matching signature for the ‘GetLicenseKey’ input. The ‘IsLicenseGenuine’ is functioning correctly and returning 0.
Hi Joshua,
Please refer to the following, your case is similar:
status = calllib(sSharedLibrary,'SetAppVersion',toString(sAppVersion)); if status ~= 0 fprintf('Error Code: %.0f\n',status) return end % Calls function to check if license is activated status = calllib(sSharedLibrary,'IsLicenseGenuine'); if status == 0 fprintf('License is genuinely activated!\n') % [status, metadataKey, metadataValue] = calllib(sSharedLibrary,'GetLicenseMetadata', toString('feature1'), blanks(256),256 ); % disp(metadataValue); elseif status == 20 fprintf('License is genuinely activated but has expired!\n') elseif status == 21 fprintf('License is genuinely activated but has been suspended!\n') elseif status == 22 fprintf('License is genuinely activated but grace period is over!\n') else % Calls function to check if license is activated trialStatus = calllib(sSharedLibrary,'IsTrialGenuine');
joadwe
July 28, 2021, 2:25pm
#3
Great, that worked. Thanks!
calllib(sSharedLibrary,‘GetLicenseKey’,blanks(256),256)