Пример #1
0
int main()
{
	int res = 0;
    __UHEAP_MARK; 
 
	// Create the control environment.
	CCoeEnv* environment = new (ELeave) CCoeEnv();    

	TRAPD( err, environment->ConstructL( ETrue, 0 ) );

	if( err != KErrNone )
	{
		printf( "Unable to create a CCoeEnv!\n" );
		getchar();            
	}
    
    TRAP( err, res = mainWithTrap());

    // Close the stdout & stdin, else printf / getchar causes a memory leak.
    fclose( stdout );
    fclose( stdin );
    
	// Cleanup
	CCoeEnv::Static()->DestroyEnvironment();
	delete CCoeEnv::Static();
       
    __UHEAP_MARKEND;
    
    return res;
}