使用 C++ (Win32) 导入 DLL

2021-12-25 00:00:00 dll import winapi c++

如何在 C++ 中导入 DLL (minifmod.dll)?

我希望能够在这个 DLL 中调用一个函数.我已经知道函数的参数列表,但我不知道如何调用它.

I want to be able to call a function inside this DLL. I already know the argument list for the function but I don't know how to call it.

有没有办法像在 C# 中一样在 C++ 中声明一个导入的函数?

推荐答案

用于声明导入函数的 C# 语法在 C++ 中不可用.以下是有关如何使用 DLL 的其他一些 SO 问题:

The c# syntax for declaring an imported function is not available in c++. Here are some other SO questions on how to use DLLs:

  • 显式加载 DLL
  • 在 C/C++ 中编译 DLL,然后从另一个程序调用它
  • 从 C++ 调用 DLL 中的函数
  • 在没有标题的 c++ dll 中调用函数
  • 如何使用 dll?
  • 这是使用 dll 的好方法吗?(C++?)

相关文章