Browse Source

add a log message and find the path of the DLL to load the configurations later

Sven Czarnian 3 years ago
parent
commit
fad3ca0de1
2 changed files with 13 additions and 1 deletions
  1. 1 1
      src/CMakeLists.txt
  2. 12 0
      src/PlugIn.cpp

+ 1 - 1
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)

+ 12 - 0
src/PlugIn.cpp

@@ -11,6 +11,10 @@
 
 #include "stdafx.h"
 
+#include <gsl/gsl>
+#include <Shlwapi.h>
+#include <Windows.h>
+
 #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<char, MAX_PATH + 1> span(path);
+    GetModuleFileNameA((HINSTANCE)&__ImageBase, span.data(), span.size());
+    PathRemoveFileSpecA(span.data());
+    std::string dllPath = span.data();
 }
 
 PlugIn::~PlugIn() noexcept { }