hello guys...how can i use iostream.h in VS2008?? im using following code but it is no t working...
#include <windows.h>
#include <iostream.h>
HANDLE hEvent;
DWORD WINAPI SampleThread(LPVOID iValue)
{
int iFinish = 120;
for(int i=100;i<=iFinish;i++)
cout<<i<<endl;
SetEvent(hEvent);
return 0;
}
void main()
{
HANDLE hThread;
DWORD dwGenericThread;
hThread = CreateThread(NULL,0,SampleThread,NULL,0,&dwGenericThread);
if(hThread == NULL)
{
DWORD dwError = GetLastError();
cout<<"SCM:Error in Creating thread"<<dwError<<endl ;
return;
}
hEvent = CreateEvent(NULL,FALSE,FALSE,"Test");
cout<<"Started waiting for the thread to complete.."<<endl ;
WaitForSingleObject(hEvent,INFINITE);
cout<<"Thread Completed."<<endl ;
CloseHandle(hEvent);
}