CoInitialize( NULL );
// Register the child window class
ZeroMemory( &wc, sizeof( wc ) );
wc.cbSize = sizeof( wc );
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = ChildWndProc;
wc.hInstance = hInst;
wc.hIcon = LoadIcon( hInst, (LPCTSTR) IDI_APPICON );
wc.hCursor = LoadCursor( NULL, IDC_CROSS );
wc.hbrBackground = GetSysColorBrush( COLOR_3DFACE );
wc.lpszMenuName = NULL;
wc.lpszClassName = CHILD_CLASS;
wc.hIconSm = LoadIcon( hInst, (LPCTSTR) IDI_APPICON );
if( RegisterClassEx( &wc ) )
{
CTTSApp DlgClass( hInst );
hr = DlgClass.InitSapi();
if( SUCCEEDED( hr ) )
{
// Create the main dialog
DialogBoxParam( hInst, MAKEINTRESOURCE(IDD_MAIN), NULL,(DLGPROC)CTTSApp::DlgProcMain,
(LPARAM)&DlgClass );
}
else
{
// Error - shut down
MessageBox( NULL,
_T("Error initializing TTSApp. Shutting down."),
_T("Error"), MB_OK );
}
}