Last reviewed: 11/29/2008
Article ID: H110804
HOW: Developing Delphi Prism .NET applications that manage grammars
The information in this article applies to:
- GrammarKit 3
If you love the features of .NET class libraries and love Delphi, then Delphi Prism is for you.
In GrammarKit 3, new Delphi Prism .NET samples have been added to illustrate managing grammars with Delphi Prism.
The Chant GrammarKit 3 Win32 Developer Edition includes v1.1, v2, and v3 compiled GrammarKit class libraries. The Chant GrammarKit 3 WinCE Developer Edition includes cf2 compiled GrammarKit class libraries.
Within a Delphi Prism project, add the Chant.GrammarKit class library to your project with the following steps:
- highlight the References folder;
- press the right mouse button and select the Add Reference menu item;
- browse to the applicable version of the component libraries Chant.GrammarKit.DLL and Chant.Shared.DLL found in C:\Program Files\Chant\GrammarKit 3\Win32 Developer\NETv1.1\bin, C:\Program Files\Chant\GrammarKit 3\Win32 Developer\NETv2\bin or C:\Program Files\Chant\GrammarKit 3\Win32 Developer\NETv3\bin; and
- click OK to add the reference to your project.
Add Chant.GrammarKit and Chant.Shared to the Uses statement in your application to reference the GrammarKit classes and members within your code.
You declare the NChantGM object as follows:
// Declare global type variable for your class object as part of your Form or Window declaration NChantGM1: NChantGM; // Declare public procedure for your event handler public method NChantGM1_HasEvent(sender: System.Object; e: HasEventArgs);
You instantiate your class objects and add and event handers for the objects as follows:
// In your Form or Window constructor, instantiate your class object NChantGM1 := new NChantGM(self); // Add reference to your event handler NChantGM1.HasEvent += new NChantGM.HasEventHandler(NChantGM1_HasEvent);
Delphi Prism sample projects are installed at [My] Documents\Chant GrammarKit 3\NETv2\VS2008\Delphi and [My] Documents\Chant GrammarKit 3\NETv3\VS2008\Delphi.