如何在bindings.inp中链接DLL在Windows 7上的节点插件

时间:2017-04-10 08:31:18

标签: c++ node.js gyp node.js-addon

我想在我的节点插件中访问DLL。我像这样配置了binding.gyp:

{
 "variables": {
  "dll_files": [
    "AUDIOPRO.DLL",
    "AUDIOSEA.DLL",
    "AUDIOSWA.DLL",
    ]
 },
 "targets": [
    {
        "target_name": "addon",
        "sources": [
            "Main.cpp"
        ],
        "libraries": [
        ]
    }
 ]
}

我在Main.cpp中尝试过这样:

const char* processAddress = "../AUDIOPRO.DLL";
HMODULE processModule = LoadLibrary(processAddress);
if (processModule == NULL) {
  // always enters here
}

问题是processModule总是为NULL,我不知道为什么......

0 个答案:

没有答案