Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Map problem
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 44656 of 47977
Post > Topic >>

Map problem

by tech <naumansulaiman@[EMAIL PROTECTED] > Apr 11, 2008 at 02:55 AM

Hi, I want to create a map of named events from a const array.

eg std::map<std::string, HANDLE> this needs to be intialised so that

initially it will be contain the names of the all the events with a
NULL handle then
i can do the following

std::map<std::string, HANDLE> Events;
std::map<std::string, HANDLE>::iterator it;

const std::string[] { "EventName1", "EventName2", "EventName3"};

it = Events.begin();

while (it != Events.end())
{
  Events[it->first] = CreateEvent(NULL,FALSE,FALSE, it->first.c_str())
  ++it;
}


So i f i ever need a new event all i need to do is add it to the array
and the event will be created
managed, destroyed just using the map.

However do i use the string array to initalise the map keys however?
 




 7 Posts in Topic:
Map problem
tech <naumansulaiman@[  2008-04-11 02:55:49 
Re: Map problem
"Jim Langston"   2008-04-11 03:48:52 
Re: Map problem
Michael.Boehnisch@[EMAIL   2008-04-11 04:49:23 
Re: Map problem
"Thomas J. Gritzan&q  2008-04-11 17:18:30 
Re: Map problem
Jerry Coffin <jcoffin@  2008-04-11 23:23:58 
Re: Map problem
"Thomas J. Gritzan&q  2008-04-12 18:20:23 
Re: Map problem
Jerry Coffin <jcoffin@  2008-04-12 11:30:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 8:41:42 CDT 2008.