Click here to Skip to main content
15,896,402 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC FrameWork concepts Pin
Jhony george28-Jun-07 21:47
Jhony george28-Jun-07 21:47 
AnswerRe: MFC FrameWork concepts Pin
Hamid_RT29-Jun-07 3:06
Hamid_RT29-Jun-07 3:06 
GeneralRe: MFC FrameWork concepts Pin
prithaa29-Jun-07 4:26
prithaa29-Jun-07 4:26 
GeneralRe: MFC FrameWork concepts Pin
Hamid_RT29-Jun-07 5:34
Hamid_RT29-Jun-07 5:34 
Questionhow to understand CFileDialog(TURE or FALSE) parameters Pin
gentleguy28-Jun-07 18:41
gentleguy28-Jun-07 18:41 
AnswerRe: how to understand CFileDialog(TURE or FALSE) parameters Pin
swarup28-Jun-07 19:04
swarup28-Jun-07 19:04 
AnswerRe: how to understand CFileDialog(TURE or FALSE) parameters Pin
swarup28-Jun-07 19:05
swarup28-Jun-07 19:05 
Questionhow to write a correct Multi Threaded Application [modified] Pin
swarup28-Jun-07 18:36
swarup28-Jun-07 18:36 
hi guys,
i have a dialog application, i want to launch 10 worker thread and each worker thread will do a particular work, ie. each worker thread will connect to a url and download the page content, and they will parse the page and write some data to a database, so imagine if there are 1000 pages then if i go by general way of geting pages one by one it will take me around 20 mins to 45 mins, so i was thinking if launch 10 thread which in term each will collect 1 page then the time may be reduced,

my problem or query is,

as fas of today is, we all using single processor, so no matter how many threads u create, any given point of time only one instruction will carried out, but when i launch more then one application of mine and break up the collection say app1 collects 100 and app2 collects another 100, this is faster then collecting 1000 in 1 application, so breakin it to threads will help or not,

how to code for it, do you have any idea i mean any design for it, or any help for it,

cas i cant write 10 diff function for each thread,i want one function to do all the work but i will pass diff parameter for each thread, but then comes the problem resource access violation if i call the same function for each thread,

so is there a way i can the thread callback to a class, or i can put the whole code, for say
class mythrdcls
{
mythrdcls(char *)
{}
void create(){}
void dothetask(){}// like a thread callback function
void running(){}
void destroy(){}
}

so please give me an idea how to do it,
ya one more thing i forgot to add here, when i call createthread or afxbeginthread, i have to call a thread callback, i want to pass some arguments to my thread callback funcion, so i can pass them in param value, i want to pass more then one value so i have to create a structure and pass it, but the problem is in thread function it does not reflect the correct value,
ie struct th
{ int x;int y} x;
x.y=10,x.x=1
beginthread(function1, x);
x.y=20,x.x=2
beginthread(function2, x);
function1()
a=x;
a.x///////////does not alwys contain 1 ie cas by the time callback is called the value is changed to 2 so how can make sure tht unless the thread callback is called the 2nd thread cant be created or ast thread get the corect value and so 2nd thread also, i used waitforsingleobject but it did not help


Thanks a lot


AnswerRe: how to write a correct Multi Threaded Application Pin
swarup29-Jun-07 5:14
swarup29-Jun-07 5:14 
QuestionProblem accessing network printers from Services Pin
Sivakumar R28-Jun-07 17:45
Sivakumar R28-Jun-07 17:45 
AnswerRe: Problem accessing network printers from Services Pin
kakan28-Jun-07 20:54
professionalkakan28-Jun-07 20:54 
GeneralRe: Problem accessing network printers from Services Pin
Sivakumar R29-Jun-07 1:39
Sivakumar R29-Jun-07 1:39 
GeneralRe: Problem accessing network printers from Services Pin
kakan29-Jun-07 1:49
professionalkakan29-Jun-07 1:49 
GeneralRe: Problem accessing network printers from Services Pin
Sivakumar R29-Jun-07 2:23
Sivakumar R29-Jun-07 2:23 
QuestionTrapping all of another process's messages Pin
Kevin Kinnett28-Jun-07 12:55
Kevin Kinnett28-Jun-07 12:55 
AnswerRe: Trapping all of another process's messages Pin
Stephen Hewitt28-Jun-07 17:10
Stephen Hewitt28-Jun-07 17:10 
AnswerRe: Trapping all of another process's messages Pin
Stephen Hewitt28-Jun-07 18:17
Stephen Hewitt28-Jun-07 18:17 
QuestionVisual C++ Pin
sherryann28-Jun-07 12:35
sherryann28-Jun-07 12:35 
AnswerRe: Visual C++ Pin
Mark Salsbery28-Jun-07 13:07
Mark Salsbery28-Jun-07 13:07 
GeneralRe: Visual C++ Pin
Rajesh R Subramanian28-Jun-07 20:55
professionalRajesh R Subramanian28-Jun-07 20:55 
GeneralRe: Visual C++ Pin
Mark Salsbery30-Jun-07 7:21
Mark Salsbery30-Jun-07 7:21 
AnswerRe: Visual C++ Pin
Christian Graus28-Jun-07 13:22
protectorChristian Graus28-Jun-07 13:22 
QuestionCompiler Options and the DDK Build Environments Pin
switang28-Jun-07 7:51
switang28-Jun-07 7:51 
AnswerRe: Compiler Options and the DDK Build Environments Pin
switang29-Jun-07 4:31
switang29-Jun-07 4:31 
GeneralRe: Compiler Options and the DDK Build Environments Pin
JudyL_MD29-Jun-07 9:58
JudyL_MD29-Jun-07 9:58 

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.