drive one application with another - c++

This is a very general question - i'll give you the shortest story that still makes sense -
I'm aware in Microsoft office, you can drive word with excel, or both word and excel with access. What I'm looking for is any guidance you can offer me.
I want to drive an application to automate the tasks that it performs-
I need the developer of that software's permission,
I need any libraries, objects, etc so I can control that program. Can you think of anything else?
What is the best plan of attack? develop something in C++ or continue down the path of writting macros?

Related

Safe to perform Word automation on open document?

I'm looking to perform Microsoft Word automation -- straightforward stuff such as instructing Word to open a document and save it as an RTF file. But what happens if the user already has the document open in a running instance of Word? Can I still safely perform automation actions (that don't modify the document itself), or am I asking for trouble? Will this interfere with the user working on the open document? Are there any alternative ways to accomplish the same thing?
I'm only interested in Word 2003 and later (but also about the Word for the Mac, as this will eventually be a cross-platform application).
There are lot of problems in doing this.
First of all Microsoft doesnt recommend to use Word for automation. use OpenXML instead. In my experience every day I ended up investigation Com exceptions by automating Word in Server.
http://support.microsoft.com/kb/257757
Even if you attempt to take the risk by automating, It is bad idea to use the machine where there is users interaction. If there is some dialog box opened like find or save as it will not allow another instance of Word to do any other functionality.
If you dont find any other solution like me then create a new user profile called OfficeAutomationUser and follow the steps in http://theether.net/download/Microsoft/kb/288367.html
Thanks for reading my Words of caution about automating. Note: I am not C++ programmer I use VSTO with C#

language and database suitable for data driven game like football manager [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I have a Cricket management game (like Football Manager) written in VB 6.0 long back. It uses MS-Access as it's back-end and win-32 API calls to draw UI screens. It's a reasonably big game with 90,000+ lines of code.
Now, I want to re-write the game using other technologies like Java, Python, C++ etc. Basically I want to get out of Microsoft technologies (and preferably move to technologies that are available for free).
So, please help me out in choosing right technologies for Application-Logic, UI and Database. Below are my broader requirements regarding the three layers.
Application-Logic:
The game needs to make 1000s of calculations on in-memory data and constantly write that data to text files (Save game files). It also needs to do very fast database operations.
UI:
The UI need not be very robust. The only requirement is to be able to develop good looking screens with minimal animation effects. Below are the links to current screen images for your reference.
http://imageshack.us/g/148/89832593.png/
I might also add 2D graphics in the future.
Database:
The database contains around 20 tables with the larger tables containing up to 300000 records. Again, I want to use a free database like MySQL or flat text files. I am very curious to know about the database used by games like "Football Manager" or "Cricket Coach 2011"
Note: Please don't consider the efforts required to learn the proposed technologies. I will take care of them.
Update:
Now that I have decided to go ahead with C++ and SQLite, please direct me regarding the IDE and basic Tools/Libraries I should be using to start with.
I am already experienced in working with "Visual Studio" and "Eclipse". Can I use one of them? or can I go with QT (I read that QT is cross platform, but, is it just for mobile development or can I use it for desktop apps too)?
And,
How critical is the IDE selection initially?
Can I move to a different IDE at a later stage?
If I use Visual Studio, am I getting bound to Microsoft technologies?
If possible, please give me links to any examples to develop screens as in the links I provided above.
[I see now that an "online game" was an assumption on my part. So keep that in mind as you read this.]
I would take into consideration your hosting options. If you want to open-source this or operate it on a shoe-string budget, and run it on the widest array of available hosting services, then you probably want to go with LAMP technologies. This would rule out my favorite language, Java, as the underlying choice of language. PHP is almost always available on inexpensive hosting options. Perl and then Python are also available on many hosts, but PHP is practically guaranteed these days.
If however, you'll be hosting this in a "whatever it takes" environment, I'm a big fan of Java, Tomcat, JBoss, etc. But those technologies, while powerful, take a lot of time to ramp up to use, but more importantly, to use effectively and efficiently.
MySQL is a great choice these days for databases. Postgresql is another free option (in some ways, maybe free-er than MySQL, given MySQL's Oracle connection.) But MySQL is likely to be more readily available on a lot of inexpensive hosts. MySQL also qualifies under "very fast operation."
Regardless of database choice, do what you can to abstract your database code so that should you want to change (or need to change) you can do it with minimal fuss. PHP and Java both have well worn ORMs to help you in this regard.
It'd be interesting to see what kind of data models are used in a game like a * Manager title. I suspect it maps well to a relational database. But I'm personally on the lookout for a good reason to dabble with a NoSQL solution.
HTML and CSS for the client to start.
For a database, I would recommend SQLite: http://sqlite.org/
It's free, fast, and serverless. Serverless being key. There are some drawbacks that you can read about on their website, but for a stand-alone application, it should be much better than using text files.

Creating a Skill Calculator for Runescape

I am beginning C++. I have a long way to go and I am one to never stop learning. I want to create a project for myself that will allow me to learn as I go. It will also give me the motivation and possibly add to my portfolio when I graduate.
The runescape skill calculator will ask for your current experience in the current skill of your choosing and your desired level.
For Example: my woodcutting experience is 60 and I want to get to lvl 5 which is 120 exp. That means im 60 experience away. by cutting oak logs I get 5 experience per log. The calculator would tell me I need to cut 12 Oak logs. All these numbers are made up.
So to my question. Where would I even begin? Hoping it would have buttons to press.
Sorry pretty new to all this. I will start with getting what I want in a Command Line first. I will be using Visual C++ 2010 express. Not sure of all the tools I will need as I am new. I can not go into detail as I do not know how I am going about this. Vague was good. Thank you
Unfortunately, a general question can only get a general answer:
First, build the program to run interactively from the command line with correct behaviour.
Then, (if you haven't designed it this way) extract the code into a class. This will allow you to call it from future programs.
Then, write an GUI that interfaces with the class.
A good set of unit tests will help throughout this project, and will make you more marketable when you present your portfolio.
For more specific answers, ask again with more detail provided.
I think that it is important to get a grip on the problem before developing.
The main questions are:
Where will you get the information about the exp. (manual input in your program, or available on-line as open data)?
Will you put your lvl in the app, or will you use the Runescape highscores API (Runescape Highscores API) and just give your UserId?
Will you get the data on the fly, or will you load them once (e.g. startup of your application). What will you do if your application runs for a long time?
How will you calculate the result you want? Are there error margins?
Afterward, you should start thinking about your UI.
Will this application be transported to different platforms?
Will you use only a text interface or something more graphical?
An now is the time to make the choice for the development architecture (what part of the code will run where: server, client, web-based, etc...). Once this choice is made, you can make a choice of development language or languages.
Visual Studio Express seems a good choice, since it permits you to choose a number of development options: client/Server, client, web application, database application, choice of development language (C, C++, C#, F), ...
Now is the time to do what Steve V. advises you to do.
As already said above: your question is general, so I could not get into more detail.
Good luck !

How does one port c++ functions to the internet?

I have a few years experience programming c++ and a little less then that using Qt. I built a data mining software using Qt and I want to make it available online. Unfortunately, I know close to nothing about web programming. Firstly, how easy or hard is this to do and what is the best way to go about it?
Supposing I am looking to hire someone to make me a secure, long-term, extensible, website for an online software service, what skill set should I be looking for?
Edit:
I want to make my question a little more specific:
How can I take a bunch of working c++ functions and port the code so I can run it server side on a website?
Once this is done, would it be easy to make changes to the c++ code and have the algorithm automatically update on the site?
What technologies would be involved? Are there any cloud computing platforms that would be good for something like this?
#Niklaos-what does it mean to build a library and how does one do that?
You might want to have a look at Wt[1]. Its a C++ web framework which is programmed more or less like a desktop GUI application. One of the use cases quoted is to bring legacy apps into the web.
[1] http://www.webtoolkit.eu
Port the functions to Java, easily done from C++, you can even find some tools to help - don't trust them implicitly but they could provide a boost.
See longer answer below.
Wrap them in a web application, and deploy them on Google App-Engine.
Java version of a library would be a jar file.
If you really want to be able to update the algorithm implementation dynamically, then you could implement them in Groovy, and upload changes through a form on your webapp, either as files or as a big text block, need to consider version control.
The effort/skillset involved to perform the task depends on how your wrote your code. If it is in a self-contained library, and has a clean (re-entrant, thread safe) API, you could probably hire a web developer (html/php/asp etc) to write the UI interface to the library for a relatively small cost. The skills required would be dependant on the technologies you wanted to use. For Windows development I would suggest C#/ASP. The applicant would require knowledge of interfacing with native libraries from a managed language. This is assuming that you dont mind the costs of Windows deployment for your application.
On the otherhand, if the library is complex or needs to be re-written to support the extensibility you are looking for, asking here will not get you much.
BTW: here is a great article on Marshalling if you chose to implement using C#/ASP
http://msdn.microsoft.com/en-us/magazine/cc164193.aspx
First, DO NOT USE PHP :D
I used it for some projects (the last one with symphony framework) and i almost shoot my self !
If you are very familiar with C++, ASP .NET could be a good solution because if you like C++ you are going to love C#.
Any ways, I personally use Ruby on Rails for 6 months now and I LOVE IT. I won't write you a book here but the framework is pure gold !
The only problem is that Ruby is a very special language. You will probably be a bit lost a the beginning. But as every one you will learn to love it.
But that was only for the server side. Indeed, there 3 technologies you won't be able to avoid if you want to start to develop web applications.
HTML, CSS and JavaScript are presents every where. This is why i'm thinking you should start by HTML and CSS then JavaScript (with jQuery).
When you've got some basics with these 3 technologies you should be able to choose the server side language.
But you've got to tell you one thing, it's not going to be easy !
PS : Ruby on Rails uses HAML and SASS. These 2 languages replaces HTML and CSS you should have a look at them quickly because they are awesome.

Are there cross-platform tools to write XSS attacks directly to the database?

I've recently found this blog entry on a tool that writes XSS attacks directly to the database. It looks like a terribly good way to scan an application for weaknesses in my applications.
I've tried to run it on Mono, since my development platform is Linux. Unfortunately it crashes with a System.ArgumentNullException deep inside Microsoft.Practices.EnterpriseLibrary and I seem to be unable to find sufficient information about the software (it seems to be a single-shot project, with no homepage and no further development).
Is anyone aware of a similar tool? Preferably it should be:
cross-platform (Java, Python, .NET/Mono, even cross-platform C is ok)
open source (I really like being able to audit my security tools)
able to talk to a wide range of DB products (the big ones are most important: MySQL, Oracle, SQL Server, ...)
Edit: I'd like to clarify my goal: I'd like a tool that directly writes the result of a successful XSS/SQL injection attack into the database. The idea is that I want to check that every place in my app does correct output encoding. Detecting and avoiding the data getting there in the first place is an entirely different thing (and might not be possible when I display data that's written to the DB by a third-party application).
Edit 2: Corneliu Tusnea, the author of the tool I linked to above, has since released the tool as free software on codeplex: http://xssattack.codeplex.com/
I think metasploit has most of the attributes you are looking for. It may even be the only one that has all of what you specify, since all the others I can think of are closed source. There are a few existing modules that deal with XSS and one in particular that you should take a peek at: HTTP Microsoft SQL Injection Table XSS Infection. From the sounds of that module it is capable of doing exactly what you are wanting to do.
The framework is written in Ruby I believe, and is supposed to be easy to extend with your own modules which you may need/want to do.
I hope that helps.
http://www.metasploit.com/
Not sure if this is what you're after, its a parameter fuzzer for HTTP/HTTPS.
I haven't used it in a while, but IIRC it acts a proxy between you and the web application in question - and will insert XSS/SQL Injection attack strings into any input fields before deeming whether the response was "interesting" or not, thus whether the application is vulnerable or not.
http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project
From your question I'm guessing it is a type of fuzzer you're looking for, and one specifically for XSS and web applications; if I'm right - then that might help you!
Its part of the Open Web Application Security Project (OWASP) that "jah" has linked you to above.
There are some Firefox plugins to do some XSS testing here:
http://labs.securitycompass.com/index.php/exploit-me/
A friend of mine keeps saying, that php-ids is pretty good. I haven't tried it myself, but it sounds as if it could approximately match your description:
Open Source (LGPL),
Cross Platform - PHP is not in your list, but maybe it's ok?
Detects "all sorts of XSS, SQL Injection, header injection, directory traversal, RFE/LFI, DoS and LDAP attacks" (this is from the FAQ)
Logs to databases.
I don't think there is such a tool, other than the one you pointed us to. I think there's a good reason for that: It's probably not the best way to test that each and every output is properly encoded for the applicable context.
From reading about that tool it seems the premise is to insert random xss vectors into the database and then you browse your application to see if any of those vectors succeed. This is rather a hit and miss methodology, to say the least.
A much better idea, I think, would be to perform code reviews.
You may find it helpful to have a look at some of the resources available at http://owasp.org - namely the Application Security Verification Standard (ASVS), the Testing Guide and the Code Review Guide.