Is it possible to write a program that gives commands to other programs than itself?
Thanks
-Chris
Printable View
Is it possible to write a program that gives commands to other programs than itself?
Thanks
-Chris
Probably.
I guess that's as much as I can say without knowing any more details.
You must learn to be more specific with your questions. Your question might just as well be "Can I control a video with a remote control?". Answer again is "Probably". It may be a video with remote control possibilities, it may not. The remote control may have the right buttons on it, maybe not. The remote may speak the same signalling language as the video, it may not... get my point?
i'll give you an example: to write a program that tells a program like napster to search a specified list of songs and download them, or that tells a program like Internet Explorer to open up a new browser and open the url: www.cprogramming.com/cboard
You can run other programs. You can also pass some arguements to a program (depending on the program) which is where the "probably" answer comes in. It is possible to talk to IE with a program but in the case of your example it would be easier for you to write your own code that tells the modem to dial-up and then d/l an html file, mp3, whatever it is that you want to do. That will require learning how to use winsock.
Where would I learn about winsock?
UNIX Network Porgramming - Volume One
UNIX you say? This is one of, if not the best socket book you'll find. WINSOCK uses bsd4.3 at heart in any case, there's only a few differances that are easy to walk around.
It's a good cover to cover read, but it's also a great referance source. As I said, there's only some small differances in the architecture, but MSDN Library covers them "pretty" well.
Goodluck.
http://world.std.com/~jimf/papers/sockets/winsock.html
As it says itself, a quick and dirty primer.
Automating web sites is very difficult mind. There is not a standard web site. Web designers call things whatever they like, and are apt to change them around at whim. Seeing a button called "Browse" and working out how to get a web site to react to your program will not make "Browse" buttons on other web sites work.
How would I write a program that gives commands to another program (to a program that is ABLE to recieve commands from other programs. Or isn't this possible? If not, how would I do this another way...?)
Thanks
-Chris
If a program has been written to be "remote controlled" it will either publish an API that a programmer can use, or it will conform to one of the standard automation protocols, (OLE, COM etc.), or there are a few other possibilities.
The COM approach is more common now, at least in the Windows world. You have probably seen this without even thinking about it, when you use certain web sites that have documents in PDF format and you click on it, up pops a Adobe. This does not mean Adobe is built into IE, rather, IE is automating Adobe to view the document, (you quite often see things like spreadsheets and databases popping up in the browser as well, this is the same technique).
In actual fact, there is even more to it than this, (plug-in's etc.), these are advanced topics, that require a lot of understanding, of the OS, of processes and process controls, synchronisation, inter process communication etc. etc.
I do not wish to put you off, but having read, and answered some of your other questions, I do not believe you should be even thinking about this stuff yet.
Alright. Thanks. I know that i'm a bit of a newbie (i'm A BIG NEWBIE, well, not that BIG), but i'm sorta got all these things that i'm curious about in C++ but I guess i'll need to learn more before I get into the advanced stuff
It's perhaps useful to point out that these are OS and application techniques, i.e. NOT C++ techniques. You can use C++ to acheive these things but that is not mandatory. It is my strong belief that COM for example, is a hundred times easier to code with Delphi than C++......