PrevNextUpHome SophiaFramework UNIVERSE 5.3

7.3. Setting up the License Code Using the Resource File

License code can be set up using the resource file.

Make the resource file that is one of the following statements.

Example 7.7. Format for the license code in the Resource File

license_code
license_code#cache:none
license_code#cache:unified
license_code#cache:separate

Write one of the following statements in the SFCApplet::Boot function as well.

Example 7.8. Format for the license code in SFCApplet::Boot function using the resource file

resource://res_file:res_id
resource://res_file:res_id/
[Note] Note
"res_file" is the name of resource file, and "res_id" is the resource ID for the string of license code.
SFCApplet::FactorySPP SFCApplet::Boot(AEECLSID id, SFXAnsiStringPtr license)
{
    *license = "resource://res_file:res_id";

    // This part varies depending on the application
    return (id == AEECLSID_HELLOWORLD) ? (&HelloWorld::Factory) : (null);
}

Enter the resource file name in "res_file", and resource ID in "res_id".

The license code should be written in the resource file as a one-line string.

Example 7.9. License code in the resource file

TIXDRQXNU5WHU8Y3Z9WOHWQR6Z3VPSDHDV5CR1S4XASPWLUHWAS7Z5Z2TGS3XMSAT3UPUQTLTARCYPSF
UEJZ6ROSJWGUQSEYKR6V2U4VESMTQLHKZ6X7Y2VKXHWIX3XBU0Z7VHWHXIZBSGT5SPU3XLX0Z1Y4R3TC
U6WGT9WHWIVNYHYCUCR9T3SMTEWPRNVAX1Y4VPW2YCY9YQV5R7Z9UIVHT6SDUPU2SIW6VCRCWBR2S4WQ
UPYFWCYGT4VIT1WHXGYPTQSFYPWNV3ULRNWFW7RBRFVKUKS2YQSQYHW1TPUPXBZ6UEY2WOYKR7S3TAU4
TQS6UHVFVEVLU3R5SDSKW7RPTNTPVQU2T4R8Z4VLUGEW3U98TLDR8

Cache options can also be set.

Example 7.10. License code with a cash option in the resource file

TIXDRQXNU5WHU8Y3Z9WOHWQR6Z3VPSDHDV5CR1S4XASPWLUHWAS7Z5Z2TGS3XMSAT3UPUQTLTARCYPSF
UEJZ6ROSJWGUQSEYKR6V2U4VESMTQLHKZ6X7Y2VKXHWIX3XBU0Z7VHWHXIZBSGT5SPU3XLX0Z1Y4R3TC
U6WGT9WHWIVNYHYCUCR9T3SMTEWPRNVAX1Y4VPW2YCY9YQV5R7Z9UIVHT6SDUPU2SIW6VCRCWBR2S4WQ
UPYFWCYGT4VIT1WHXGYPTQSFYPWNV3ULRNWFW7RBRFVKUKS2YQSQYHW1TPUPXBZ6UEY2WOYKR7S3TAU4
TQS6UHVFVEVLU3R5SDSKW7RPTNTPVQU2T4R8Z4VLUGEW3U98TLDR8#cache:none
[Warning] Warning
The license code in the resource file must not include any line feed characters such as CR(Carriage Return) and LF(Line Feed).