Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call c++ dll by using loadlibrary #92

Open
ricky-yi opened this issue May 28, 2019 · 2 comments
Open

call c++ dll by using loadlibrary #92

ricky-yi opened this issue May 28, 2019 · 2 comments

Comments

@ricky-yi
Copy link

Everything works when the environment setup with option I.

And because my dev machine can't connect to Internet, I use option 2 to setup node-gyp, it works ok but loading c++ dll with loadlibray, compile succeed, but run error by returning NULL handle.

are there any configure options should be set in option 2.

Thanks.

Following are the 2 options:

Environment setup and configuration:
•Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator).
•Option 2: Install dependencies and configuration manually
i.Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio 2017 Community (using the "Desktop development with C++" workload)
ii.Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7
iii.Launch cmd, npm config set msvs_version 2017

@ricky-yi
Copy link
Author

my code:
HMODULE hdll = LoadLibrayA("xxx.dll");
if(!hdll) { cout << "error: " << GetLastError() << endl;

when running, hdll is null and error code is 0 which means run successfully.

@mcastillo86
Copy link

I'm having the exact same problem. Can someone figure out what the issue is please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants