I am writing a Microsoft Service in C++. This service should dynamically load at runtime a .dll library located in a subfolder in the same folder as the executable. However, as someone told me, the actual working directory of the service is not the same as the executable directory, therefore the library is not found and not loaded.
As proof of this fact, I am able to load the library if I start the service executable as an application.
The folder structure of the application is as follows:
FOLDER\Service.exe
FOLDER\SUBFOLDER\library.dll
How would you access it as a service?
You can extract the directory from the current module path. You can use GetModuleFileName to retrieve file path of the current executable
Related
I have a qt desktop application and i am required to use selenium for developing automated tests on it.
I found this web driver option: https://github.com/cisco-open-source/qtwebdriver
I cloned, build and installed the driver according to this wiki:
https://github.com/cisco-open-source/qtwebdriver/wiki/Build-And-Run
and also checked the web driver running on port 9517 according to this wiki.
Now i want to bind the web driver to my project.
I followed this wiki:
https://github.com/cisco-open-source/qtwebdriver/wiki/Use-QtWebDriver-to-run-your-application
in the second section, Option 1: WebDriver attaches to the running application.
when i am adding the "Headers.h" file, i get the error:
"base/at_exit.h": No such file or directory
i guess its because i didnt do the parent step as needed ("Add the QtWebDriver headers and libraries in the application build environment")
im not sure i added the webdriver project as needed.
to add the librarys i choosed "Add Library" -> "External Library" in the wizard, and choosed all the so files from the webdriver project.
then i also added all the existing h files by choosing "add existing files" in the Headers folder of my project.
is it the right way to add the library to my project?
what am i missing?
i solved the problem
added include_directories of the folder containns "base" folder to the cmakelists file
I need to load BouncyCastle jars for mail encryption using the java loader. (ColdFusion 10 and no Application.cfc). When an older version of a jar exists in the lib directory, that version is loaded and not the one specified in the javaloader.
Even when I create a jar with BouncyCastle jars in the classpath and call a "facade" in ColdFusion, the jars in the lib directories are first loaded and it gives errors (the jar runs perfect in Java)
Does someone know if there is a way to ensure loading of the specified jars (new versions) and not those from the lib directories with the java loader?
I am developing a C++ application using Netbeans remote development platform. I don't know how to specify the libraries that are on the remote server, in my local Netbeans IDE. If I go through the normal procedure of specifying them in the project properties, I am getting only the local files and not remote files. please help.
It's the first time that I heard such a "requirement". Why should you want to access files over the internet during development? Why don't you install the needed libraries on your local machine, develop your software and then build a proper installer with all the needed files?
I have a Web Service deployed (as an aar) file to Axis2, but the dependencies (in the form of .jar files within the lib directory of the aar file) are not found on execution. They do get used properly if I copy them into the WEB-INF lib directory of the Axis2 installation, but this is not an ideal workaround.
Does anybody know of any configuration settings I might have missed? Has anybody got a
aar file (on OC4J or other server) with Axis2 v1.2? I'm not sure whether my problem is with Axis2, so might have to deploy the service to a Tomcat server to check but would rather not go through that cycle if someone can point me in the right direction.
Thanks,
You can put the jars into a lib directory inside the AAR. as pointed out in Where to deploy a jar dependency of my webservice?
This will help you understand the structure of the aar file -http://axis.apache.org/axis2/java/core/docs/quickstartguide.html
I have a C++ console application that I want to deploy using a vs2008 setup project. When I create the setup project and add the output from my console app, the setup project detects that it needs MSVCP90.dll and MSVCR90.dll. When I build the project, those two dlls are included in the .msi file as expected.
When I download and launch the installer, everything goes as expected and the console app and the dlls are unpacked into the proper directory on the local machine.
When I try and run the app, I get the following error:
Error 1721. There is a problem with
this Windows Installer package. A
program required for this install to
complete could not be run. Contact
your support personnel or package
vendor.
I've tried compiling the app with /MT and /MD neither one works.
When I run a dependency walker against the app, it reports that it needs MSVCP90.dll and MSVCR90.dll as expected.
Finally, if I set the installer to require the Visual C++ runtime libraries, it downloads them and everything works fine.
Obviously, I would like to avoid downloading the CRT libraries.
Thanks for any help,
Jon
Check out this example on how to add the appropriate merge modules and deploy them to your target machine along with your setup.