Click here to Skip to main content
15,919,613 members
Home / Discussions / Article Writing
   

Article Writing

 
GeneralRE: Button like the File-Open button in Word2000 Pin
Stas Levin31-Jan-00 13:13
Stas Levin31-Jan-00 13:13 
QuestionSource code to access Netscape's registry format nsreg.dat? Pin
Anonymous17-Jan-00 7:18
suss Anonymous17-Jan-00 7:18 
AnswerRE: Source code to access Netscape's registry format nsreg.dat? Pin
Brian V. Shifrin25-Jan-00 0:36
sussBrian V. Shifrin25-Jan-00 0:36 
AnswerRE: Source code to access Netscape's registry format nsreg.dat? Pin
Brian V. Shifrin25-Jan-00 0:41
sussBrian V. Shifrin25-Jan-00 0:41 
GeneralSending Formatted text through MAPI Pin
Eli Vingot17-Jan-00 2:42
sussEli Vingot17-Jan-00 2:42 
GeneralRE: Sending Formatted text through MAPI Pin
willi wacker7-Mar-00 20:48
willi wacker7-Mar-00 20:48 
QuestionThread pool? Pin
Member 252283214-Jan-00 5:11
Member 252283214-Jan-00 5:11 
AnswerRE: Thread pool? Pin
Andreas16-Feb-00 3:38
Andreas16-Feb-00 3:38 
I have a simple soucecode. I should not be a problem to implement it with MFC once you understand how it works (unfortinally the reverse is not so easy. MFC to simple function)












Why does the program use other y pos than it was assigned?
Sleep can solve bugs that is hard to find.
Remove the comment to se the effect of sleep.

_____________________________________________________________________________________
#include <windows.h>
#include <process.h>
//Make sure you use Project->Settings->C/C++ ->Code Generation->Use runtime library->"Multithreaded dll"
#include <iostream.h>
HANDLE hStdOut;

char space[10];
DWORD test=0;
#define MAX_CONCURRENT_THREADS 10


BOOL MyFunc(int x);
HANDLE hEvent;
void main(void)
{

hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );

int x=0;
hEvent = CreateEvent(0,0,0,0);
while(x<max_concurrent_threads)
{
="" _beginthread((void="" (__cdecl="" *)(void="" *))myfunc,0,(void*)x);
="" sleep(100);
="" x++;
="" }
waitforsingleobject(hevent,infinite);=""

="" *if(closehandle(hevent))
{

="" messagebox(0,"success!!","",0);

}*=""
while(1)
{
="" _endthread();
}
cout<<"done";
}

bool="" myfunc(int="" x)
{
coord="" coord;
coord.x="0;
coord.Y=x;
" int="" n="x*10000;
" while(1)
="" writeconsoleoutputcharacter(hstdout,_itoa(n,space,10),9,coord,&test);
="" sleep(1);="" remove="" the="" comment="" to="" se="" effect="" of="" sleep.
="" n++;
="" setevent(hevent);
="" if(n="">500000)
_endthread();
}

return 1;
}



Regards
Andreas


==================
The original message was:

Hi,

Have anyone any sample how to do a thread pool
to win32 with C++ ?

Regards

MiLa

QuestionProtected Storage API? Pin
Andrei Stcherbatchenko29-Dec-99 14:44
Andrei Stcherbatchenko29-Dec-99 14:44 
Generaldatabase & database cursor Pin
Valentin Rozescu13-Dec-99 4:04
Valentin Rozescu13-Dec-99 4:04 
Generalplaying multiple notes from memory Pin
Laura Michaels20-Dec-99 4:03
sussLaura Michaels20-Dec-99 4:03 
GeneralSuperclassing Pin
Ivan A. Fotan19-Dec-99 3:19
Ivan A. Fotan19-Dec-99 3:19 
GeneralRE: Superclassing Pin
Andrei Zenkovitch20-Dec-99 5:32
Andrei Zenkovitch20-Dec-99 5:32 
QuestionDoes anyone have: mpeg decoding source code (C++)? Pin
kai16-Dec-99 5:48
kai16-Dec-99 5:48 
GeneralNew cool Windows 2000 Open File Dialogs with MFC Pin
Member 466015-Dec-99 5:05
Member 466015-Dec-99 5:05 
GeneralRE: New cool Windows 2000 Open File Dialogs with MFC Pin
Erik Thompson15-Dec-99 9:34
sitebuilderErik Thompson15-Dec-99 9:34 
GeneralRE: New cool Windows 2000 Open File Dialogs with MFC Pin
Jesse Ezell15-Dec-99 11:53
Jesse Ezell15-Dec-99 11:53 
GeneralRE: New cool Windows 2000 Open File Dialogs with MFC Pin
Andrei Zenkovitch20-Dec-99 5:49
Andrei Zenkovitch20-Dec-99 5:49 
GeneralRE: New cool Windows 2000 Open File Dialogs with MFC Pin
Jeremy Davis16-Feb-00 22:42
Jeremy Davis16-Feb-00 22:42 
GeneralRe: New cool Windows 2000 Open File Dialogs with MFC Pin
Thomas Freudenberg14-Apr-00 5:25
Thomas Freudenberg14-Apr-00 5:25 
Generalclass CBitmapDC : public CDC Pin
Jason Hattingh11-Jan-00 0:19
sussJason Hattingh11-Jan-00 0:19 
GeneralRE: class CBitmapDC : public CDC Pin
RAJIV16-Jan-00 10:26
RAJIV16-Jan-00 10:26 
GeneralRE: class CBitmapDC : public CDC Pin
Chris Maunder9-Feb-00 13:03
cofounderChris Maunder9-Feb-00 13:03 
QuestionRichEditCtrl - pasted text not visible initially!? Pin
Steve Roach5-Jan-00 2:24
Steve Roach5-Jan-00 2:24 
AnswerRE: RichEditCtrl - pasted text not visible initially!? Pin
Wes Rogers17-Jan-00 12:47
Wes Rogers17-Jan-00 12:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.