Registry access

by Jul 15, 2020

I have just begun attempting to access the Registry using Windows 10 and Builder 10.3.3 Rio and immediately ran into a problem:

"[bcc32c Error] Unit1.cpp(15): unknown type name 'TRegistry'".

The code in Unit1.cpp is:

//—————————————————————————

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//—————————————————————————
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//—————————————————————————
__fastcall TForm1::TForm1(TComponent* Owner)
 : TForm(Owner)
{
 TRegistry* reg = new TRegistry(KEY_READ);
 reg->RootKey = HKEY_LOCAL_MACHINE;

 reg->Access = KEY_READ;
 bool openResult = reg->OpenKey("HARDWARE\SERIALCOMM\", true);
}
//—————————————————————————

Can anyone tell me what I am missing?