![]() |
|
#1
|
|||
|
|||
std map to vector for waitformultipleobjects parameterHi,
I have a set of channel objects. Each channel has a set of Win32 event objects associated with it. I want to store the Win32 event objects in a std::map as follows: CPP / C++ / C Code:
The problem is WaitForMultipleObjects(...) requires the event handles to be passed in as a const HANDLE *. So I can pass in a vector<HANDLE> as &events but I need to pass in the std::map above. Any ideas? I could always construct the std::map as an std::vector by sequentially ordering channel events into a long std::vector but not sure that's the best approach. -cacoder Last edited by admin : 14-Apr-2009 at 21:34.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#2
|
|||
|
|||
Re: std map to vector for waitformultipleobjects parameterIf you're trying to wait for all the HANDLE objects in the map, you won't be able to do it this way. The alternative is to create an array of HANDLE and copy each handle into that as well as store it in your map. Question though, if both the event_index and the ch_index values go from 0 to some number continously, why not just use either a 2 dimensional array or 2 dimensional vector?
CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: std map to vector for waitformultipleobjects parameterYou are correct in that I could just use a two dimensional vector. I decided to just use a one dimensional vector and have an enum index all events in the vector. It keeps the design simple.
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Minimum value parameter problem | tones1986 | C++ Forum | 3 | 03-Apr-2006 10:46 |
| find the value in the array that is closest in value to the second parameter | jack223 | C++ Forum | 4 | 04-Nov-2005 07:58 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 21:30 |
| Re: Command Line Arguments, Part 1 | WaltP | C Programming Language | 0 | 11-Jul-2004 00:34 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 10-Mar-2004 00:56 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The