Developing C++Builder applications that manage profiles

Last reviewed: 7/15/2011

HOW Article ID: H071124

The information in this article applies to:

  • ProfileKit 4


You can develop C++Builder applications that manage speaker profiles using your favorite version of C++Builder.

More Information

ProfileKit includes C++Builder header files comprised of the C++Builder classes that manage grammars and automatically load and unload the runtime DLL.

To access the ProfileKit C++Builder classes within your application, first add a project reference to the C++Builder header include files:

  1. Within your C++Builder project, select Project Options.
  2. Select the C++Builder compiler options
  3. Add Include path reference to the ProfileKit header files directory: C:\Program Files\Chant\ProfileKit 4\Win32\CBuilder\include

To access the ProfileKit C++Builder classes within your application, add a reference to the ProfileKit Header file in your C++Builder application header file:

#include "cchantpm.h"

Add a reference in your C++Builder application source file to the ProfileKit code needed to dynamically load and unload the runtime DLL:

#include "CChantProfileKit.cpp"

Object Instantiation

Declare a global variable for the ChantPM class, instantiate an instance, set the license and serial properties, and set the event handler message.

Add the following to your application header file:

void __fastcall OnHasEvent(TMessage& msg);
MESSAGE_HANDLER(WM_APP+6, TMessage, OnHasEvent);
// User declarations
CChantPM* ChantPM1;

Add the following to your application source file:

ChantPM1 = new CChantPM();

// Set license properties

// Define the HasEvent callback message
ChantPM1->SetWindowMessage(Handle, WM_APP+6, 0, 0);

Event Callbacks

Event callbacks are the mechanism in which the component library sends information back to the application such as import/export operation state, training state, or there was an error.

void __fastcall TForm1::OnHasEvent(TMessage& msg)
    int numberOfEvents = ChantPM1->GetResourceCount(CSREvent,0,0);
    for (int i = 0; i < numberOfEvents; i++)
        // Get the event from the event queue
        CChantPMEvent* pEvent = ChantPM1->GetChantPMEvent(0);
        switch (pEvent->GetChantCallback())
            case CCSRProgress:




        // Remove the event from the event queue
        delete pEvent;

Deployment Checklist

When you are ready to deploy your C++Builder application, you need to ensure you have a valid license, bundle the correct Chant component library, and configure your installation properly on the target system. Review the following checklist before deploying your applications:

  • You may deploy your C++Builder application to any system with a valid license from the Chant.
  • Copy CProfileKit.dll to the target system and place in the same directory with your application.

Sample Projects

C++Builder sample projects are installed at the following location:

  • My Documents\Chant ProfileKit 4\Win32\CBuilder\RS 2007,
  • My Documents\Chant ProfileKit 4\Win32\CBuilder\RS 2009,
  • My Documents\Chant ProfileKit 4\Win32\CBuilder\RS 2010,
  • My Documents\Chant ProfileKit 4\Win32\CBuilder\RS XE, and
  • My Documents\Chant ProfileKit 4\Win32\CBuilder\RS XE2.