I want to make dll application with wxWidgets.Long time I use c++ Builder for making dll application but I also want to work on Visual Studio.Please help!
I search on google about this but did't find any information about this or just have 2 example and one is didn't work and one is in wxWidgets folder and I cant understand how to make it work.
Related
I am currently working on a C++ gui application. The application uses the Python/C API to call some python scripts. The scripts are located in the solution directory, and I call them by simply providing the path. This is currently working fine while debugging the application or even running the generated .exe file, but I am wondering how this could work if I want to release and distribute the application onto a different computer for someone to use. How can these scripts be deployed with the application?
I also have a .ttf font file with the same situation. How can this resource file be deployed with the application?
In other words, I want to deploy/release a C++ application with the scripts and resource files.
FYI: the C++ application is a Visual Studio project.
Thanks for the help in advance, and let me know if any more information is needed!
Update:
I just wanted to clear up the way my project is working currently:
PyObject* pArgs = PyTuple_New(5); // I setup the arguments the python function needs
PyImport_ImportModule("requests"); // imports...
// make python call
PyObject* pResult = PyObject_CallObject(pFunc, pArgs);
So this is (for the most part) how I call the scripts with the C++ source code. The scripts are located in a folder that is located in the solution directory.
I hope this explains my problem a little better.
Update:
Just another little update... Using some answers to other similar questions got me to the following point:
I need to obtain a python library, compile and link it with my C++ application, and then bundle the dependencies with the application (How to distribute C++ application which calls Python?)
So I guess my question is now shifting to how I would be able to get this done. What are the specific steps to do this? I also got a link (https://docs.python.org/3.5/using/windows.html#embedded-distribution) to an embedded distribution of a python environment (maybe this should somehow be used?). Also, I am able to statically link python into the application. I just don't know how to bundle and deploy the scripts I created and use in the application.
PyImport_ImportModule("requests")
The parameter is "requests".
Put the py file aside exe file when distributing.
So, you need to make sure that the C++ application can still access the python libraries when its released and those libraries/dependencies arent necessarily available on other systems.
You'll need to, like another commenter suggested, use one of the importing modules utilities, like PyImport_ImportModule("library name").
You can see these utilities here: https://docs.python.org/3/c-api/import.html
You'll also need to either
Put the libraries that you want with the exe (in the same directory) or
put them in the system environment path ( which is probably less straightforward).
Hope that helps and that I understood you're question correctly.
I am going to be making a project with OpenCV and (probably) Qt for GUI and I was just wondering what kind of project I should create in visual studio? Would it be the Win32 Project or Win32 Console Application or just an Empty Project? A lot of them are quite obvious as I am not making a Dll or makefile but do not know the difference between the others. Thanks in advance.
Which type of project you decide to pick in Visual Studio depends what will best fits your needs. Since I do not know your exact needs, the best answer I can give is explain the difference between the types of Project Options and give examples when you would choose to use the given project:
Win32 Project: A Win32 Project is one of the options Visual Studio provides to you, and if chosen will provide the user with template code that generates a "window", that window being just like any other window (browser window, folder window, etc), but one that your program controls.
Examples: Making a calculator, making an application that needs a window with buttons for the user to communicate with the program, etc.
Win32 Console Application: In this option, Visual Studio provides a Command Prompt interface where the user can input data and also where output can appear. Basically it's the black window where you can input commands and receive information of what is happening in your program.
Examples: When testing out code (it makes debugging easier in some cases), when the program really doesn't need to be too elaborate, etc.
There are other options available, thou these two were mentioned in your post and are probably the most popular among developers.
After installing Qt and maybe a Qt-VisualStudio-Plugin you have some new options when creating a New Project:
You should choose Qt Application in most cases. Not sure if you can use a GUI with Qt Console Application, but you'll get a terminal/console in that case.
After choosing project name, you can easily choose the Qt Modules you'll need. This adds them to your project settings, so you don't have to add the manually (but I guess you can do so later if you need more modules).
The project will create a .ui file which you can open/edit with QtDesigner. The project will perform all the moc and uic compile steps automatically and you don't have to add those things manually.
I think this is the easiest way to use the combination of Qt and Visual Studio.
Adding OpenCV to Visual Studio is easy:
Just add the include directories and the correct OpenCV libraries.
The question whether to use a consolse application or not depends on your needs.
Personally, I like printing development output to a console, but maybe you don't want that in your final project ;)
I trying to figure out how to execute simple win32 API from NPAPI plugin
done with firebreath Framework ,
i found this example :
https://github.com/hasegawayosuke/npwin32/tree/master/npwin32
but im not sure if i can implement it in firebreath , can someone help me out please?
There is nothing magical about firebreath as far as executing a windows API goes. You'd do it the same way you'd do it from any other C++ application or library. If you have a specific windows API you want to call then we might be more helpful, but generally I just include the correct header and make the API call -- no need to specifically loadlibrary the .dll myself.
If you really want an example of doing it manually, you can find one in the firebreath codebase itself, in the file src/PluginCore/Win/SystemHelpersWin.cpp
So im a bit confused by what to-do with this current pop-up im having from QT. Not entirely sure what it means.
So i'm trying to create a C++ Library, as a static linked library. Currently the library has no code in it whatsoever.
Immediately hitting the build button to make sure everything runs fine the following pop-up below is displayed.
Im not sure what this means exactly. Or indeed, why it is even being shown in the first place. building any of my other project files works fine without issue. But this does not.
.
As for what i have, i am using the Qt SDK, version 4.8.1.
Any help solving this issue would be greatly appreciated :).
A library [usually] needs to be invoked from an executable - The dialog box you are seeing is asking you to specify an executable that will bring your library into life and call functions within it.
You need to write a client executable (or use an existing executable) to use your library and specify the path in this dialog box.
The button you clicked was probably the Run button:
, not the build button: .
Information about what I want to do:
-read in a few integer variables from a text file that will be located on a dropbox public folder.
-the variables will be used to trigger some if statements thus controlling my application remotely if I need to have it do something ( I would just save the variable I need to that text file and my program with would read from it every 5 seconds would see it and perform the required actions).
-this is a console application which is being built and compiled in visual studio 2010 on windows 7. The software will also be running on a win7 computer.
I need help with:
I already have read on using a library called libcurl. The problem is that I do not know how to link this library with my project in vs2010. Detailed instructions on how to do this on vs 2010 would be very helpful.
OR
if you can think of a better and easier way to accomplish what I need done, offer some advice and direction
It sounds like you're a novice, is that correct? If not then apologies for stating the obvious.
To use your compiled DLL in your application you need to 'add a reference' to it. You can do this by adding what is called a binary reference, where you simply tell visual studio where to find the dll. Or you can add a project reference if the project which is producing the dll is within the same solution. The best approach is to use something called nuget. It's a visual studio extension which automates the adding of binary references available from a public repository.
I have just done a search for libcurl on nuget.org and drew a blank. As I am unfamiliar with this library you may have better luck finding a nuget package as you will be a le to search using better terms that I did (curl and libcurl)
Whatever approach you take, just right-click on the project in which you want to use libcurl within the solution explorer and you should find an add reference option in the menu.