triggering another program to run

July 21, 2009 at 00:58:59
Specs: Windows 2000
hello, is it possible that when i run a program on computer A, it will trigger the serial port of computer B so that another program in computer B will run? The computers are connected by a null modem cable and both programs are written in C++ language and is running in a console application.

The programs are actually a kind of text file transferring between two computers where computer B will read a content from an existing textfile in that computer and send it line by line untill the end of line to computer A and exits itself. Computer A will log the textfile content into a newly created textfile.

The program is currently working but i have to run the program in computer A first which will start polling for an input and then i go to computer B to click and run the program so that it will start transferring.

My question is, can i do it in a way that when i run the program in computer A, it will automatically trigger the program in computer B to run without having to click on the program in computer B to run? If it is possible, how can i do it in c++? Does the program in computer B have to be in a sleep mode? I can paste the code for the programs in computer A and computer B if needed. Thanks!

See More: triggering another program to run

Report •

July 21, 2009 at 05:24:50
The only way you are going to get that to work is to have the programme on computer B running, either as a stub in the startup list or a system service that when triggered by the programme on computer A. loads the main programme.

When you end information to a RS232 serial port there has to be comething at the other end to recieve it, another application running that is either polling the serial port is is part of the serialports interrupt service routine. If there is nothing there to process the information it will just disapear out of the buffer and go nowhere.


Report •

July 21, 2009 at 19:01:42
How do i write a program for computer B to start running as a stub or a service? I am very new in programming, please guide, thanks!

Report •

July 22, 2009 at 02:15:16
If you have already written a programme to trnsfer data between two computers you are half way there already. A stub is just a short peogramme that does a specifc task and then starts another. If you are reading incoming information on Computer B you already have he code to create a stub.

A system service is a bit more complicated. The most elegant solution but the most difficult to implement. This should get you started.

The Internet is full of information on programming, lots of it. All you need is to Google it and read it.


Report •

Related Solutions

Ask Question