Click here to Skip to main content
15,918,624 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Calling a COM interface from a worker thread Pin
Stuart Dootson13-Aug-09 21:07
professionalStuart Dootson13-Aug-09 21:07 
GeneralRe: Calling a COM interface from a worker thread Pin
Stuart Dootson14-Aug-09 2:08
professionalStuart Dootson14-Aug-09 2:08 
QuestionHow to log visited URLs Pin
televes13-Aug-09 5:51
televes13-Aug-09 5:51 
AnswerRe: How to log visited URLs [modified] Pin
Bacon Ultimate Cheeseburger13-Aug-09 12:12
Bacon Ultimate Cheeseburger13-Aug-09 12:12 
JokeRe: How to log visited URLs Pin
Moak13-Aug-09 13:43
Moak13-Aug-09 13:43 
GeneralRe: How to log visited URLs Pin
televes14-Aug-09 10:51
televes14-Aug-09 10:51 
AnswerRe: How to log visited URLs Pin
kilt17-Aug-09 3:36
kilt17-Aug-09 3:36 
GeneralMSI installation: problem when Norton Antivirus is active Pin
VictorSotnikov13-Aug-09 5:47
VictorSotnikov13-Aug-09 5:47 
GeneralRe: MSI installation: problem when Norton Antivirus is active Pin
Bacon Ultimate Cheeseburger13-Aug-09 16:11
Bacon Ultimate Cheeseburger13-Aug-09 16:11 
Questionrand() causing unresolved external symbol Pin
Member 321680813-Aug-09 5:05
Member 321680813-Aug-09 5:05 
AnswerRe: rand() causing unresolved external symbol Pin
Stuart Dootson13-Aug-09 5:17
professionalStuart Dootson13-Aug-09 5:17 
GeneralRe: rand() causing unresolved external symbol Pin
Member 321680813-Aug-09 5:25
Member 321680813-Aug-09 5:25 
QuestionRe: rand() causing unresolved external symbol Pin
Randor 13-Aug-09 12:56
professional Randor 13-Aug-09 12:56 
AnswerRe: rand() causing unresolved external symbol Pin
Member 321680814-Aug-09 3:27
Member 321680814-Aug-09 3:27 
QuestionWord automation question Pin
sashoalm13-Aug-09 4:54
sashoalm13-Aug-09 4:54 
AnswerRe: Word automation question Pin
Stuart Dootson13-Aug-09 5:11
professionalStuart Dootson13-Aug-09 5:11 
GeneralRe: Word automation question Pin
sashoalm13-Aug-09 5:35
sashoalm13-Aug-09 5:35 
GeneralRe: Word automation question Pin
Stuart Dootson13-Aug-09 22:17
professionalStuart Dootson13-Aug-09 22:17 
QuestionStatic pointer Pin
kumar sanghvi13-Aug-09 4:22
kumar sanghvi13-Aug-09 4:22 
AnswerRe: Static pointer Pin
Cedric Moonen13-Aug-09 4:29
Cedric Moonen13-Aug-09 4:29 
GeneralRe: Static pointer Pin
kumar sanghvi13-Aug-09 5:03
kumar sanghvi13-Aug-09 5:03 
GeneralRe: Static pointer Pin
sashoalm13-Aug-09 21:00
sashoalm13-Aug-09 21:00 
QuestionSequencing or queuing parallel process [modified] Pin
s v joshi13-Aug-09 3:36
s v joshi13-Aug-09 3:36 
AnswerRe: Sequencing or queuing parallel process Pin
Iain Clarke, Warrior Programmer13-Aug-09 4:10
Iain Clarke, Warrior Programmer13-Aug-09 4:10 
Given your description... I don't think you need much in the way of kernel stuff.

This is very loose code, as I don;t have my compiler handy,

struct Task
{
   sometimestruct Time;
   THREAD_ROUTINE Thread;
};

Task tasks [] = { { MakeTimeSomehow (1515), TaskA}, { MakeTimeSomehow (1600), TaskB}, ...  { 0, NULL} };

for (nTask; tasks [nTask]; nTask++)
{
   int nSeconds = TimeBetweenNowAnd (tasks [nTask].Time);
   if (nSeconds < 0) nSecconds = 0;

   Sleep (1000 * nSeconds);  // wait till desired time, or 0ms if we should get on with it!

   HANDLE hThread = StartThread (tasks [nTask].Thread, ......);
   WaitForHandle (hThread);   // a thread handle is a waitable object, just like an event.
   CloseHandle (hThread);
}


Job done!

I might just put in some abort flag too... I only expect this to give you an idea. The main trick is that a thread handle is waitable, just like events, semaphores, etc.

Iain.

I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]

AnswerRe: Sequencing or queuing parallel process Pin
Stuart Dootson13-Aug-09 5:09
professionalStuart Dootson13-Aug-09 5:09 

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.