Enable MSFS 64 bit build

This commit is contained in:
Roland Rossgotterer
2021-03-16 16:12:35 +01:00
committed by Mat Sutcliffe
parent 7e04a2c40f
commit 308081cfcc
6 changed files with 48 additions and 13 deletions

View File

@@ -244,6 +244,35 @@ bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version)
return false;
}
}
bool loadAndResolveMSFSimConnect()
{
// Check if already loaded
if (gSymbols.SimConnect_Open) { return true; }
QString simConnectFileName(QStringLiteral("SimConnect.MSFS"));
QLibrary simConnectDll(simConnectFileName);
simConnectDll.setLoadHints(QLibrary::PreventUnloadHint);
if (simConnectDll.load())
{
const bool resolvedCommon = resolveCommonSimConnectSymbols(simConnectDll);
if (!resolvedCommon)
{
CLogMessage(CLogCategories::driver()).error(u"Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName;
return false;
}
CLogMessage(CLogCategories::driver()).info(u"Loaded and resolved MSFS symbols from SimConnect.dll: '%1'") << simConnectFileName;
return resolvedCommon;
}
else
{
CLogMessage(CLogCategories::driver()).error(u"Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString();
return false;
}
}
#else
bool loadAndResolveFsxSimConnect(bool manifestProbing)
{

View File

@@ -39,6 +39,8 @@ FSXCOMMON_EXPORT bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version);
//! Same but string version
inline bool loadAndResolveP3DSimConnectByString(const QString &version) { return loadAndResolveP3DSimConnect(stringToP3DVersion(version)); }
FSXCOMMON_EXPORT bool loadAndResolveMSFSimConnect();
#else
//! Load and resolve FSX SimConnect.