A static string table can be built in any .mmp file; the most common use is as part of building an application.
The following is an example .mmp file, StringTableExample.mmp:
// StringTableExample.MMP TARGET StringTableExample.exe TARGETTYPE exe SYSTEMINCLUDE \epoc32\include SOURCEPATH . SOURCE StringTableExample.cpp START STRINGTABLE ExampleStringTable.st EXPORTPATH /epoc32/include END LIBRARY EUSER.LIB BAFL.LIB VENDORID 0x70000001
Note: The previous example .mmp file builds the following .cpp file that uses the string pool:
// StringTableExample.cpp #include "e32base.h" #include "e32svr.h" #include "StringPool.h" #include "ExampleStringTable.h" void StartL() { TBuf<100> buf; RStringPool pool; pool.OpenL( ExampleStringTable::Table ); buf.Copy( pool.StringF( ExampleStringTable::EApple,ExampleStringTable::Table ).DesC() ); RDebug::Print( buf ); } // main loop // GLDEF_C TInt E32Main() { // Install exception handler CTrapCleanup* theCleanup = CTrapCleanup::New(); TRAPD( err,StartL() ); delete theCleanup; return( KErrNone ); }