MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / InitInstance

Method InitInstance

Source/FamiTracker.cpp:103–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101// CFamiTrackerApp initialization
102
103BOOL CFamiTrackerApp::InitInstance()
104{
105 // InitCommonControls() is required on Windows XP if an application
106 // manifest specifies use of ComCtl32.dll version 6 or later to enable
107 // visual styles. Otherwise, any window creation will fail.
108 InitCommonControls();
109#ifdef SUPPORT_TRANSLATIONS
110 LoadLocalization();
111#endif
112 CWinApp::InitInstance();
113
114 TRACE(L"App: InitInstance\n");
115
116 if (!AfxOleInit()) {
117 TRACE(L"OLE initialization failed\n");
118 }
119
120 // Standard initialization
121 // If you are not using these features and wish to reduce the size
122 // of your final executable, you should remove from the following
123 // the specific initialization routines you do not need
124 // Change the registry key under which our settings are stored
125 // TODO: You should modify this string to be something appropriate
126 // such as the name of your company or organization
127 SetRegistryKey(L"");
128 LoadStdProfileSettings(MAX_RECENT_FILES); // Load standard INI file options (including MRU)
129
130 // Load program settings
131 m_pSettingsService = make_unique_nothrow<CSettingsService>(); // // //
132 if (!m_pSettingsService)
133 return false;
134 m_pSettingsService->LoadSettings();
135
136 // Parse command line for standard shell commands, DDE, file open + some custom ones
137 CFTCommandLineInfo cmdInfo;
138 ParseCommandLine(cmdInfo);
139
140 if (CheckSingleInstance(cmdInfo))
141 return FALSE;
142
143 // Load custom accelerator
144 m_pAccel = make_unique_nothrow<CAccelerator>(); // // //
145 if (!m_pAccel)
146 return FALSE;
147 m_pAccel->LoadShortcuts(GetSettings());
148 m_pAccel->Setup();
149
150 // Create the MIDI interface
151 m_pMIDI = make_unique_nothrow<CMIDI>();
152 if (!m_pMIDI)
153 return FALSE;
154
155 // Create sound generator
156 m_pSoundGenerator = make_unique_nothrow<CSoundGen>(); // // //
157 if (!m_pSoundGenerator)
158 return FALSE;
159
160 // Start sound generator thread, initially suspended

Callers

nothing calls this directly

Calls 15

IsWindowsVistaOrGreaterFunction · 0.85
sizeFunction · 0.85
FormattedWFunction · 0.85
LoadShortcutsMethod · 0.80
DefaultSettingsMethod · 0.80
SaveSettingsMethod · 0.80
GetDocStringMethod · 0.80
IsEmptyMethod · 0.80
OnOpenDocumentMethod · 0.80
GetSongCountMethod · 0.80
GetModuleMethod · 0.80
AssignDocumentMethod · 0.80

Tested by

no test coverage detected