Click here to Skip to main content
15,902,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to using the bmp pic of the resource to fill a rectangle? Pin
kk_Kevin11-Nov-09 19:49
kk_Kevin11-Nov-09 19:49 
QuestionRe: how to using the bmp pic of the resource to fill a rectangle? Pin
David Crow12-Nov-09 3:10
David Crow12-Nov-09 3:10 
QuestionProcess Termination waiting for Event - Win32 Pin
Krischu11-Nov-09 1:08
Krischu11-Nov-09 1:08 
AnswerRe: Process Termination waiting for Event - Win32 Pin
Covean11-Nov-09 1:27
Covean11-Nov-09 1:27 
GeneralRe: Process Termination waiting for Event - Win32 [modified] Pin
Krischu11-Nov-09 2:35
Krischu11-Nov-09 2:35 
GeneralRe: Process Termination waiting for Event - Win32 Pin
Covean11-Nov-09 3:03
Covean11-Nov-09 3:03 
GeneralRe: Process Termination waiting for Event - Win32 [modified] Pin
Krischu11-Nov-09 3:43
Krischu11-Nov-09 3:43 
GeneralRe: Process Termination waiting for Event - Win32 Pin
Covean11-Nov-09 4:01
Covean11-Nov-09 4:01 
You can try ResetEvent or change this event handle to an "empty" event you only create but never fire,
but I think the best way is to recreate the handle array without the process handle (be aware of that also the WAIT_OBJECT_0 + x value for all other events (after the process handle) changes if you remove this handle).

Here some pseudocode how I would solve this problem.

#define TIMEOUT_EVENT 0

struct WaitObject
{
    HANDLE hWaitFor;
    int nEventId;
}

int WaitForObjects(WaitObject[] waitObjects, bool bWaitAny, ....)
{
    int nRetVal = 0;
    int nLoop = 0;
    HANDLE arrayWaitObjectHandles[waitObjects.Length]; // ok its not really C ^^
    for(; nLoop < waitObjects.Length; nLoop++)
        arrayWaitObjectHandles[nLoop] = waitObjects[nLoop].hWaitFor;

    nRetVal = WaitForMultipleObjects(waitObjects.Length, &arrayWaitObjectHandles, ...);
    if(nRetVal == TIMEOUT)
        return TIMEOUT_EVENT;
    return waitObjects[nRetVal - WAIT_OBJECT_0].nEventId;
}


I know that this is not fully C (its too long ago^^) but I hope you understand the idea behind this,
just to build a function that waits for you and returns event ids (you assigned), so it will be easier
to remove the process handle from this array, because you waits for your assigned event ids.

I hope that helps.

PS: Viel Spass damit! Poke tongue | ;-P

Greetings
Covean

QuestionChanging _MBCS to _UNICODE create problem Pin
m_mun11-Nov-09 0:51
m_mun11-Nov-09 0:51 
AnswerRe: Changing _MBCS to _UNICODE create problem Pin
MsmVc11-Nov-09 1:06
MsmVc11-Nov-09 1:06 
GeneralRe: Changing _MBCS to _UNICODE create problem Pin
m_mun11-Nov-09 2:01
m_mun11-Nov-09 2:01 
GeneralRe: Changing _MBCS to _UNICODE create problem Pin
Richard MacCutchan11-Nov-09 2:48
mveRichard MacCutchan11-Nov-09 2:48 
QuestionRe: Changing _MBCS to _UNICODE create problem Pin
22491711-Nov-09 6:23
22491711-Nov-09 6:23 
AnswerRe: Changing _MBCS to _UNICODE create problem Pin
Randor 11-Nov-09 9:49
professional Randor 11-Nov-09 9:49 
QuestionAfterCalculate is missing in Excel.tli, version: Office 2003 Pin
KTTransfer11-Nov-09 0:35
KTTransfer11-Nov-09 0:35 
AnswerRe: AfterCalculate is missing in Excel.tli, version: Office 2003 Pin
MsmVc11-Nov-09 1:01
MsmVc11-Nov-09 1:01 
GeneralRe: AfterCalculate is missing in Excel.tli, version: Office 2003 Pin
KTTransfer12-Nov-09 17:41
KTTransfer12-Nov-09 17:41 
GeneralRe: AfterCalculate is missing in Excel.tli, version: Office 2003 Pin
MsmVc12-Nov-09 17:45
MsmVc12-Nov-09 17:45 
QuestionA Spell Checking Engine Compatible for Visual C++ 2005 Pin
napadaan11-Nov-09 0:26
napadaan11-Nov-09 0:26 
AnswerRe: A Spell Checking Engine Compatible for Visual C++ 2005 Pin
Chris Losinger11-Nov-09 4:13
professionalChris Losinger11-Nov-09 4:13 
Questionwhat is dwExtraInfo in KBDLLHOOKSTRUCT Pin
Nitheesh George10-Nov-09 23:27
Nitheesh George10-Nov-09 23:27 
AnswerRe: what is dwExtraInfo in KBDLLHOOKSTRUCT Pin
Covean10-Nov-09 23:51
Covean10-Nov-09 23:51 
QuestionLoading exe fromDVD issue [modified] Pin
kumar sanghvi10-Nov-09 23:26
kumar sanghvi10-Nov-09 23:26 
QuestionHow can open diffrent pages of Help file or CHM? Pin
Le@rner10-Nov-09 22:54
Le@rner10-Nov-09 22:54 
AnswerRe: How can open diffrent pages of Help file or CHM? Pin
SandipG 10-Nov-09 23:54
SandipG 10-Nov-09 23:54 

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.