MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / InitInstance

Method InitInstance

legacy/D3Launch/D3Launch.cpp:291–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291BOOL CD3LaunchApp::InitInstance() {
292 // AfxEnableControlContainer();
293
294 // Get a handle for the executable's resources (english)
295 m_hDefResInst = AfxGetResourceHandle();
296
297 // Get the title of the launcher
298 SetLauncherTitleString();
299
300 // If a previous instance of the application is already running,
301 // then activate it and return FALSE from InitInstance to
302 // end the execution of this instance.
303 if (!FirstInstance()) {
304 return FALSE;
305 }
306
307 // Create the Mutex to signal that the Launcher is currently running
308 if (CreateMutex(NULL, TRUE, D3_LAUNCHER_MUTEX_NAME) == NULL) {
309 return FALSE;
310 }
311
312 // Initialize the com object for this ap
313 CoInitialize(NULL);
314
315 // parse the command line
316 OutrageParseCommandLine();
317
318 // check to see if the Setup dialog should be displayed right away
319 m_straight_to_setup = (UINT)os_config_read_uint(szSectionName, "StraightToSetup", 1);
320
321 // check to see if the launcher sound is enabled
322 LauncherSoundEnabled = os_config_read_uint(szSectionName, "LauncherSoundEnabled", 1);
323
324 // check for an updated version text file
325 ProcessUpdatedVersionFile();
326
327 // Setup Config Defaults for Releases
328#if (defined(FULL_US_RELEASE) || defined(FULL_AUSSIE_RELEASE) || defined(OEM_GENERIC))
329 LanguageSelectionEnabled = FALSE;
330 EregEnabled = TRUE;
331#elif (defined(FULL_ROW_RELEASE) && !defined(INITIAL_UK_RELEASE))
332 LanguageSelectionEnabled = TRUE;
333 EregEnabled = FALSE;
334#elif (defined(FULL_ROW_RELEASE) && defined(INITIAL_UK_RELEASE))
335 LanguageSelectionEnabled = FALSE;
336 EregEnabled = FALSE;
337#else
338 LanguageSelectionEnabled = FALSE;
339 EregEnabled = FALSE;
340#endif
341
342#ifdef DEMO
343 // see if user needs Glu32.dll
344 ProcessGlu32DLL();
345#endif
346
347 // Standard initialization
348 // If you are not using these features and wish to reduce the size

Callers

nothing calls this directly

Calls 6

SetLauncherTitleStringFunction · 0.85
os_config_read_uintFunction · 0.85
ProcessGlu32DLLFunction · 0.85
GetBitmapAndPaletteFunction · 0.85
DoModalMethod · 0.45

Tested by

no test coverage detected