Original Post
Hello I have a problem that I needed help for like 3 weeks. Im going to write a text base game similar to a MUD but it is for one player only so I my program a SUD (Single User Dungeon). Anyway Im found a basic multi thread example that runs on the command prompt. But for some reason It doesnt run for me correctly. It runs perfectly on two computers that have Windows XP Pro but it not working ok my computer which is running Window Me. Im using Visual C++ 6 and Im doing the program in C++. When you run the program your out put should be this:
Intro to Windows Threading by redKlyde
HAHAH!!!! This is me ... the thread ... I am running!!
Press any key to continue . . .
And this works perfectly on Windows XP Pro but when I run it on my computer it outputs this:
Intro to Windows Threading by redKlyde
Press any key to continue . . .
Im not sure why this is happening all the functions that I used is compatible with Windows Me and it works on Windows XP Pro so why wouldnt it work on my computer that runs Windows Me. I thought it had something to do with something installed or something so I formated my hard drive and tried to compile the program again but it still didnt work. The program doesnt work right on Dev C++ 4 either. I hope some one could find out whats wrong with my program. Some one please help me Thanks in Advance Franklin!!. By the way this is the source of the program that''s not working.
#include <iostream>
#include <windows.h>
#include <stdlib.h>
using namespace std;
void threadProc()
{
cout << "HAHAH!!!! This is me ... the thread ... I am running!!\n";
}
void main()
{
cout << "Intro to Windows Threading by redKlyde\n";
HANDLE threadHandle;
threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) threadProc, NULL, 0, NULL);
WaitForSingleObject(threadHandle, INFINITE);
system("pause");
}