"How difficult (ie - possible :) is it to get say a CGI script that is attached to a webpage to alert a running program that was coded in C++"
Better question - how insecure would that be? And this is on Windows.
"this is tedious"
Well, this is linear message passing. It's always tedious.
This is why J2EE and .NET exist. They (more easily) allows this kind of communication in an OO model, particularly in n-tier architectures. When I say n-tier, I am refering to the essential component steps in the transaction (logical or physical). The web browser and web server would be (in loose terms) a 2-tier architecture. A browser, server, and database would be 3-tier (very common).
The simplest way is to place data your data in a third tier. You mentioned a text file. That would be the filesystem (meaning overhead). A better way is a database (much more controlled).
You want to keep these components seperate. Integrating them is not only time-intensive and error-prone, it is also dangerous. If this were a bigger project you would create (or buy) a transaction server, through which you could control in explicit ways interprocess communication over transparent medium (maybe the same localhost, maybe over the Internet).
Aside from the database, there are other ways to communicate between the two processes. The basic way is to make a daemon on the localhost which is listening and waiting for some data from the CGI script. However, this means you have to be very careful about both the script and the daemon - there are a lot of ways to introduce errors in this using C++.
A shared memory scheme might be a little over the top. JNI works, but you have already seen the overhead in that. Additionally an XML-RPC scheme would be too complex as well (it would also require server configuration). Though you might consider writing to an XML file. This would cut out a lot of possible problems with the text file idea. You can get XML document generation and parsing support in many languages.
Still, I would go with the database and have a seperate token. The token alerts the process by some oddball method to query the database (or read the file, etc.). The simplest token is some packet sent to a some port the C++ process is listening on. The C++ process gets the syn, maybe sends an ack, for example. Then the query is performed. You could also take a framework like JNI, and cheat and pass your token through that. It would be a waste of resources (and overkill) to be sure, but it would also solve the problem.
It really depends on the level of interoperability the two processes need. If it is just a one-way pass, most things will work well. If it is some two-way communication and maybe negotiation, you need a better hackjob or an actual framework.
Or, you could explore the possibility of evoking the C++ process as CGI or in the CGI script. The practicality of doing this should be very apparent (i.e. you immediately see its a good option or it is out of the question).