如何在Delphi中连接到具有此类功能的dll?

问题描述 投票:0回答:0

这里是 C++ 函数

#ifdef LOGGER_EXPORTS
#define LOGGER_API __declspec(dllexport)
#else
#define LOGGER_API __declspec(dllimport)
#endif

extern "C" LOGGER_API void LogMessage(const json& message);

extern "C" LOGGER_API std::vector<json> getCommands();

extern "C" LOGGER_API void CreateLogger(const std::string& infilename, const std::string& outfilename, const std::string& idinfilename, const std::string& idoutfilename);

extern "C" LOGGER_API void CreateLoggerWithLogs(const std::string& infilename, const std::string& outfilename, const std::string& idinfilename, const std::string& idoutfilename,
    const std::string& logInput, const std::string& logOutput);

我不明白如何转换类型。此外,当我们调用 CreateLogger 时,我们创建了该类的静态实例。在我调用析构函数之前,它会像在 C++ 中一样存在吗?

c++ delphi
© www.soinside.com 2019 - 2024. All rights reserved.