diff --git a/MSICA/MSICA.cpp b/MSICA/MSICA.cpp index 3bce013..f5402b3 100644 --- a/MSICA/MSICA.cpp +++ b/MSICA/MSICA.cpp @@ -87,7 +87,7 @@ UINT MSICA_API MSICAInitialize(MSIHANDLE hInstall) //::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK); UINT uiResult; - BOOL bIsCoInitialized = SUCCEEDED(::CoInitialize(NULL)); + winstd::com_initializer com_init(NULL); MSICA::COpList olInstallCertificates, olRemoveCertificates, olInstallWLANProfiles, olRemoveWLANProfiles, @@ -584,7 +584,6 @@ UINT MSICA_API MSICAInitialize(MSIHANDLE hInstall) ::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg); } - if (bIsCoInitialized) ::CoUninitialize(); return uiResult; } diff --git a/MSICA/stdafx.h b/MSICA/stdafx.h index 7aef926..dc8eb41 100644 --- a/MSICA/stdafx.h +++ b/MSICA/stdafx.h @@ -23,6 +23,8 @@ #define MSICA_DLL // This library is compiled as a DLL #endif +#include + #include #include