# Specifying a Serial Number in C++

> Pass your serial number to Create in the WM_CREATE handler of a Visual C++ application, so that TX Text Control ActiveX shows no trial dialog box to end users.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control ActiveX > Installation Guide > Specifying a Serial Number in C++
- **569 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/installation/licensing/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/installation/licensing/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/installation/licensing/llms-full.txt

---

If you use TX Text Control ActiveX in a development system other than Visual Basic, you may have to set the license information for the control from your application. Visual C++ is one of the development systems that don't support the licensing model of Visual Basic.

> Warning
>
> **Missing License Information.** Without the license information, your application isn't distributed correctly: the dialog box with the trial version information is displayed on the end user's machine all the time.

![The TX Text Control Trial Version dialog box of TX Text Control ActiveX 34.0 SP5, which says that a nag screen appears every time the program starts and every fifteen minutes.](https://docs.textcontrol.com/assets/img/tx-text-control-activex/trial-version-dialog.423ea560.webp)

### Pass the Serial Number When the Control Is Created

Set the serial number before any other call to TX Text Control. The following code comes from the `WM_CREATE` handler of a Visual C++ sample application, which creates the control and passes the serial number as its last parameter:

```cpp
...
if (CWnd::Create(lpszClassName, lpszWindowName, dwStyle,rect,
   pParentWnd, nID, pContext) == 0)
   return 0;
WCHAR szLic[] = L"TS-1234567890";
BSTR bstrKey = SysAllocString(szLic);
BOOL bSuccess = m_txctrl.Create(NULL, dwStyle, rect,
   this, 1000, NULL, NULL,bstrKey);
SysFreeString(bstrKey);
if (!bSuccess)
   return 0;
...
```

The code works as follows:

- **`szLic`** holds the license string. It must be a valid Text Control serial number: replace the example string "TS-1234567890" with yours.
- **`SysAllocString`** turns the string into the `BSTR` that `Create` expects, and `SysFreeString` releases it after the call.
- **`m_txctrl.Create`** creates the control with the serial number in its last parameter. The handler returns 0 when the window or the control can't be created.

### Use the Trial Version

The trial version of TX Text Control has no license information. Call the `Create` method with an empty string for the serial number.

### Related Pages

- [Distributing Your Applications](https://docs.textcontrol.com/tx-text-control-activex/deployment/redistribution/llms-full.txt): the files you install with your application.
- [Installing TX Text Control on a Server](https://docs.textcontrol.com/tx-text-control-activex/installation/server/llms-full.txt): the serial number on a server.

---

## Nearby

- **Previous:** [Installing TX Text Control on a Server](https://docs.textcontrol.com/tx-text-control-activex/installation/server/llms-full.txt)
- **Next:** [Getting Started](https://docs.textcontrol.com/tx-text-control-activex/getting-started/llms-full.txt)
