mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Previously the FSX/P3D driver tried to link a very specific SimConnect version from the Windows Assembly cache. This caused issues with machines which did not have this specific version of SimConnect in the assembly cache since drivers refused to load without much information. Having a different version of SimConnect in the assembly cache or even in the bin folder did not help. To fix this problem, SimConnect is now loaded and resolved manually at runtime. This allows to try loading different versions from the assembly cache or prefer to load the shipped one. For this, the manifests are linked into the binary's resource section and activated manually before loading. This has the positive effect, that loading errors can be handled by code instead of raising a cryptic error and aborting.
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
/* Copyright (C) 2018
|
|
* swift Project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \cond PRIVATE_TESTS
|
|
|
|
/*!
|
|
* \file
|
|
* \ingroup testblacksimplugin
|
|
*/
|
|
|
|
#include "testsimconnectsymbols.h"
|
|
#include "plugins/simulator/fsxcommon/simconnectsymbols.h"
|
|
#include "plugins/simulator/fsxcommon/simconnectwindows.h"
|
|
#include <QTest>
|
|
|
|
namespace BlackSimPluginFsxP3D
|
|
{
|
|
void CTestSimconnectSymbols::resolveSymbols()
|
|
{
|
|
QVERIFY2(loadAndResolveSimConnect(false), "Could not load and resolve SimConnect library!");
|
|
HANDLE hSimConnect;
|
|
SimConnect_Open(&hSimConnect, "Test", nullptr, 0, 0, 0);
|
|
SimConnect_Close(hSimConnect);
|
|
}
|
|
|
|
} // ns
|
|
|
|
//! \endcond
|