Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

What libraries would I need to make a program that interacts with others and stuff? (Sorry for poor wording)?

I've been working with C++ for about a year now and I've gotten into GUI and past basic syntax and I'm curious as to how to make a program that effects another program, application, etc. Any libraries, functions or just any insight you can provide would be much appreciated! :)

And please keep in mind I am only a year into it and I am not completely into the advanced material yet and I haven't really made a fully functional program yet so please kind of dumb it down to a novice level if possible but if not I can always Google whatever vocabulary or Jargon you use. :)

Update:

Sorry I completely left out that the language I am using is C++ and my compiler is GCC.

1 Answer

Relevance
  • 6 years ago
    Favorite Answer

    > "Sorry I completely left out that the language I am using is C++ and my compiler is GCC."

    But you didn't say what platform!

    From your previous questions about the WinAPI, I'm guessing you're running some sort of MSYS or MinGW setup. If you're instead developing under a POSIX environment (i.e., Cygwin), you should say so.

    > I'm curious as to how to make a program that affects another program, application, etc.

    That's a broad goal. There's a quite a few mechanisms you can choose from --- some of them you've encountered by now, and others are bad ideas, or poor solutions:

    1. You can edit global state that another program reads --- a file, a registry key, etc.

    2. You can invoke, terminate, send signals to a process or one of its threads.

    3. You can make calls into and modify foreign process memory.

    4. You can connect to a process listening on a network via sockets

    5. You can read or write into shared process memory

    6. You can use Windows' "remote procedure call" facilities

    7. You can pipe information via standard streams

    8. You can use Windows' horrible "distributed component object model" framework

    I'm sure I'm missing some methods, too: there's quite a few, and they're all suitable in different cases.

    The most versatile of these are "sockets" (#4).

    This is the networking mechanism --- client and server stuff.

    The canonical sockets library is Berkeley Software Distribution Sockets (BSD Sockets for short). It is now POSIX; Windows has a nonstandard copycat variant called "Winsock" (Windows Sockets), which remains as a older version of BSD Sockets with more bugs.

    Play around with it.

    Here's the docs:

    https://msdn.microsoft.com/en-us/library/windows/d...

    https://msdn.microsoft.com/en-us/library/windows/d...

Still have questions? Get your answers by asking now.