Monday, 10 April 2017

how to link dll in bindings.gyp for node addon on windows 7

i want to access dll in my node addon, i configure my binding.gyp like this:

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

i tried like this in Main.cpp:

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

}

processModule always be NULL, i don't know why....



via anny

No comments:

Post a Comment