Aargh mailslots and the like!!
Hi guys,
i just registered, and since there is no point in lying.... ill tell you straight off. Im a inforatics student from holland, and i have an home work assignment... BUT i dont want you guys making it for me but help me with... So here goes:
I need to write a C++ program which starts 3 (with help from createprocess) ms-dos boxes each printing a, b, c when it their turn. So first box 1 prints a then box 2 prints a then box three prints a and after this box 1 prints b, and so forth and so on...
But when only one ms-box is running it will print: abcabcabcabc etc, etc.
This process needs to be synchronized with mailslots...
Ok im just beginnen but this is what i have so far:
Code:
void main()
{
// Set the startup information
STARTUPINFO startup_info = {0};
startup_info.cb = sizeof startup_info;
PROCESS_INFORMATION pi = {0};
// Create the process
CreateProcess("D:\\ipc\\opdracht\\debug\\printer.exe", "D:\\ipc\\opdracht\\debug\\printer.exe", NULL, NULL, FALSE, 0, NULL, NULL, &startup_info, &pi);
}
Where printer.exe is the program which prints abcabcbabc....
But i need three of those boxes, simply copying the piece of code i have three times doesn't work.... anybody wiling to help a lost soul here?