MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / NFD_Init

Function NFD_Init

extern/nfd/nfd_win.cpp:306–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304} // namespace
305
306nfdresult_t NFD_Init(void) {
307 // Init COM library.
308 HRESULT result =
309 ::CoInitializeEx(nullptr, ::COINIT_APARTMENTTHREADED | ::COINIT_DISABLE_OLE1DDE);
310
311 if (SUCCEEDED(result)) {
312 needs_uninitialize = true;
313 return NFD_OKAY;
314 } else if (result == RPC_E_CHANGED_MODE) {
315 // If this happens, the user already initialized COM using COINIT_MULTITHREADED,
316 // so COM will still work, but we shouldn't uninitialize it later.
317 needs_uninitialize = false;
318 return NFD_OKAY;
319 } else {
320 NFDi_SetError("Failed to initialize COM.");
321 return NFD_ERROR;
322 }
323}
324void NFD_Quit(void) {
325 if (needs_uninitialize) ::CoUninitialize();
326}

Callers 3

InitFunction · 0.50
openFileDialogMethod · 0.50
saveFileDialogMethod · 0.50

Calls 1

NFDi_SetErrorFunction · 0.70

Tested by

no test coverage detected