简体   繁体   中英

Why does my call to my 64bit DLL keep returning "Error opening DLL xxxx" when running my 64bit app?

Here's the deal. We have an in-house DLL written in C++ and compiled in MSVS 10. Originally it was created to call COBOL and was only 32bit. We then recompiled the DLL last year to be 64bit and my app (written in PowerBuilder) was able to call it with no issues.

We're now converting the COBOL to Java classes by way of Veryant COBOL which has required some changes to be made to the DLL. Please note, I didn't write this DLL and have very minimal experience with C++. I recently had to take over this part of the project so please be easy with me:)

After the developer made the required changes to call the Java classes the 32bit can be called by my 32bit app with no issues. However, the 64bit version when called by my 64bit app always ends up resulting in "Error opening DLL". I've made sure the DLL and the app are both 64bit. I've looked over all the properties of the project and everything points to 64 environment/variables. Warnings are produced during the build due to variables still using 32bit types but the same occurs for the version that is used for the regular 64bit COBOL and it works.

Due to different working environments I run a batch file to start my app in order to set the required variables for Veryant or for COBOL, depending on which system I'm running. The only issue I'm having is calling the 64bit DLL that's compiled to call the 64bit Java classes. Does anyone have any suggestions on how to track down the issue? I'm at a complete loss at this point.

I tried taking the 32bit version of the "Veryant" DLL that I am able to call and went through all of the properties of the project and changed everything to be 64bit. I rebuilt the DLL, received warnings of the variables which exist in the working 64bit COBOL version, but got a successful build. I expected to be able to call this DLL from my 64bit app but still receive the "Error opening DLL" message.

Make sure that the DLL is located in a directory that is listed in the PATH environment variable. This will allow the application to find the DLL when it tries to load it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM