I've searched a lot of info, about the easiest way to create and edit excel files to save some login and passwords of my program. I've seen lots of C# methods and I don't understand it a lot.
I've added a reference to Visual Studio 2010 Microsoft.Office.Interop.Excel (I'm using Office 2010).
I don't know how to take this further, however; what headers should I add, what else should I do? I can't find any tutorial of C++ using this on their projects. I just want something simple.
EDIT:
I will run my program on a pc that has Office 2010 installed.
read these
http://support.microsoft.com/kb/216686/en-us?fr=1
http://www.codeguru.com/cpp/data/mfc_database/microsoftexcel/article.php/c11745/Microsoft-Excel-Automation-Class.htm
Does the system where your application will run on have Excel installed or not?
If it does, you can use indeed use Excel as a COM component. https://learn.microsoft.com/en-us/previous-versions/office/troubleshoot/office-developer/automate-excel-from-c contains an example on how to do this.
If your system does not have Excel installed, you need to use a 3rd party library to create the Excel files for you. Just Google for "create excel files without excel" and you will find dozens of example code.
Related
everyone. I have a problem with qt in reading excel.
I have written a app which will read some excel file by QAxObject , and it works.
But I want to deploy this program in static library. I find my app can't work when the office software is't installed.
I want to know if there exsits someway which can read the excel when there is no prerequisite, or is therr some lib I can integrated to my app.
thanks so much to your attention
I find a good website which may be useful for the others.
https://wiki.qt.io/Handling_Microsoft_Excel_file_format
I am trying to access from Visual C++ 2010 Express a Postgres database. I have both on my machine but the SQL calls do not work at all. I have searched many sites. I think that this version of Express does not have any default database connections like the non-express version (especially Visual C++ 2008).
The only thing I could find was the following link and I have following the modifications to the Project Properties area of Visual C++ Express.
http://www.askyb.com/cpp/c-postgresql-example/
When I try to run the C++ code in that website I get errors indicating that it cannot find the functions.
Do you have any ideas of what I am doing wrong? Would it be better for me to use something other than Visual C++ Express 2010 to connect to a postgres db? One of the other Express versions? The regular (non-express) Visual C++?
Thanks
You may also be interested in libpqtypes and libpqxx if you're working with PostgreSQL and libpq. The first provides greatly simplified access to data values from libpq, and the latter provides a more C++-friendly interface.
As for the errors, most likely:
Your include path or link library path is wrong if it's failing at compile-time or link time; or
Your PATH doesn't include libpq, if it's failing at runtime.
Most likely (you didn't provide any actual error messages) the problem is your setup. You need to add the correct header ("include") directory and library directory; if you just copied them from some tutorial, make sure they actually point to the real place where these files (.h and .lib files, respectively) are.
You need do recompile the libpq with MSVC (nmake /f win32.mak all), after that, you need to set your project to use that library, and change the Common Language Runtime Support to (/clr) and not to clr/pure.
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.
From my understanding a .wsdl file consists of an xml specification. This abstract way of defining code is then converted into usable code via some means.
I have a C++ program that I am creating in Visual C++ express. I am trying to use a .wsdl file but am unsure about how to proceed. I am presuming that somehow I can add the url of the wsdl and have the code generated automatically.
I've seen similar questions which seem to suggest that there is a way to add web reference but I have looked and cannot find this option on Visual C++ 2010 Express.
You can use WsUtil to generate client stub in C++ that you can call from your code.
I am not sure if visual studio provides such an option, having said that I think
You need a library like Apache Axis's WSDL2WS tool which will generate stubs for you by using the wsdl as input.
I'm new to c++ and am trying to alter the console app code posted below to read multiple files, ideally using a wildcard extension. Can some please give me some pointers..?
http://msdn.microsoft.com/en-us/library/ms916815#odc_wssusageeventlogging_examiningtheusagelogfileformat
-----------Edit-------
What I need is how to change the code above instead of pointing it to a specific [filename.log] point it to a directory name and let it process all the log files in that directory.
--------------Tools-----
Win32 Console Application project in Visual Studio 2010 in C++
[To be run on win 32 bit platform]
Using Win32 APIs you can list the files in a directory by following this example. From there it should be relatively trivial for you to incorporate that code into your application to allow you to process multiple files as requested.
Specifically the FindFirstFile API allows for wildcard when search for files.
If you're willing to use the boost library check out
this post. If you're using something like C++/CLI then there is support in .NET for this as well (I'm assuming for now you're not using C++/CLI). If you specify the tools at your disposal maybe you can get a more directed answer.