Load P3D 64 bit SimConnect shared library at runtime

This aligns the behavior and concept with the 32 bit FSX version. SimConnect
is loaded at runtime, depending on the version being selected.
It also adds a featuren to change the P3D SimConnect version at runtime by
unloading the previous and loading a new one.

ref T349
This commit is contained in:
Roland Winklmeier
2018-10-24 14:01:12 +02:00
committed by Klaus Basan
parent 0f140cb155
commit f63008dd3f
10 changed files with 183 additions and 63 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "simulatorfsx.h"
#include "../fsxcommon/simconnectsymbols.h"
using namespace BlackMisc;
using namespace BlackMisc::Aviation;
@@ -39,5 +40,18 @@ namespace BlackSimPlugin
CAircraftIcaoCode("B738", "L2J")
});
}
bool CSimulatorFsx::connectTo()
{
if (!loadAndResolveFsxSimConnect(true)) { return false; }
return CSimulatorFsxCommon::connectTo();
}
void CSimulatorFsxListener::startImpl()
{
if (!loadAndResolveFsxSimConnect(true)) { return; }
return CSimulatorFsxCommonListener::startImpl();
}
} // ns
} // ns

View File

@@ -31,6 +31,11 @@ namespace BlackSimPlugin
BlackMisc::Weather::IWeatherGridProvider *weatherGridProvider,
BlackMisc::Network::IClientProvider *clientProvider,
QObject *parent = nullptr);
//! \name ISimulator implementations
//! @{
virtual bool connectTo() override;
//! @}
};
//! Listener for FSX
@@ -41,6 +46,9 @@ namespace BlackSimPlugin
public:
//! Constructor
using CSimulatorFsxCommonListener::CSimulatorFsxCommonListener;
protected:
virtual void startImpl() override;
};
} // ns
} // ns