Пример #1
0
bool ff::ProcessGlobals::Startup()
{
    HookCrtMemAlloc();

#if !METRO_APP
    assertHrRetVal(::OleInitialize(nullptr), false);

    INITCOMMONCONTROLSEX cc;
    cc.dwSize = sizeof(cc);
    cc.dwICC  = ICC_WIN95_CLASSES;
    verify(::InitCommonControlsEx(&cc));
#endif

    // Init random numbers
    SYSTEMTIME time;
    GetSystemTime(&time);
    std::srand((DWORD)(HashFunc(time) & 0xFFFFFFFF));

    assertRetVal(ff::ThreadGlobals::Startup(), false);

    assertRetVal(CreateAudioFactory(&_audioFactory), false);
    assertRetVal(CreateGraphicFactory(&_graphicFactory), false);
    assertRetVal(CreateServiceCollection(&_services), false);
    assertRetVal(CreateThreadPool(&_threadPool), false);

    GetThisModule();
    ProcessStartup::OnStartup(*this);

    return true;
}
Пример #2
0
ff::ViewWindow::ViewWindow(MainWindow *window, IServiceProvider *contextServices)
	: _mainWindow(window)
	, _viewType(ViewType::UNKNOWN)
	, _active(false)
	, _allowLayout(false)
{
	verify(CreateServiceCollection(window->GetServices(), &_services));
	SetContextServicesInternal(contextServices);
}