From fad3ca0de1b5bc63ba8a659a15599612ab942927 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Wed, 11 Aug 2021 08:29:14 +0200 Subject: [PATCH] add a log message and find the path of the DLL to load the configurations later --- src/CMakeLists.txt | 2 +- src/PlugIn.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ffc99d..a29153b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,7 +49,7 @@ ADD_LIBRARY( # define the dependencies TARGET_INCLUDE_DIRECTORIES(ArrivalMANager INTERFACE EuroScope) -TARGET_LINK_LIBRARIES(ArrivalMANager EuroScope GSL) +TARGET_LINK_LIBRARIES(ArrivalMANager EuroScope GSL Shlwapi.lib) # configure the debugger and update the linker flags IF(MSVC) diff --git a/src/PlugIn.cpp b/src/PlugIn.cpp index 508fd60..7592c58 100644 --- a/src/PlugIn.cpp +++ b/src/PlugIn.cpp @@ -11,6 +11,10 @@ #include "stdafx.h" +#include +#include +#include + #include "PlugIn.h" using namespace aman; @@ -22,6 +26,14 @@ PlugIn::PlugIn() : PLUGIN_DEVELOPER, PLUGIN_COPYRIGHT), m_configuration() { + this->DisplayUserMessage(PLUGIN_NAME, "INFO", (std::string("Loaded ") + PLUGIN_NAME + " " + PLUGIN_VERSION).c_str(), true, true, false, false, false); + + /* get the dll-path */ + char path[MAX_PATH + 1] = { 0 }; + const gsl::span span(path); + GetModuleFileNameA((HINSTANCE)&__ImageBase, span.data(), span.size()); + PathRemoveFileSpecA(span.data()); + std::string dllPath = span.data(); } PlugIn::~PlugIn() noexcept { }