Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is there any API for Data? Pin
Saurabh.Garg10-Nov-08 21:15
Saurabh.Garg10-Nov-08 21:15 
Questionhelp! How to ceate a custom skin application Pin
petterroea10-Nov-08 19:50
petterroea10-Nov-08 19:50 
AnswerRe: help! How to ceate a custom skin application Pin
enhzflep10-Nov-08 19:55
enhzflep10-Nov-08 19:55 
AnswerRe: help! How to ceate a custom skin application Pin
Hamid_RT11-Nov-08 4:21
Hamid_RT11-Nov-08 4:21 
QuestionDisplay Images from Remote Machine(Performance Issue Query) Pin
Super Hornet10-Nov-08 19:00
Super Hornet10-Nov-08 19:00 
QuestionWhich is the best method to copy the files from remote system to local system? Pin
Super Hornet10-Nov-08 22:06
Super Hornet10-Nov-08 22:06 
QuestionRe: Display Images from Remote Machine(Performance Issue Query) Pin
Mark Salsbery11-Nov-08 7:13
Mark Salsbery11-Nov-08 7:13 
QuestionUpdating and retrieving data from a map. Pin
CodingLover10-Nov-08 18:33
CodingLover10-Nov-08 18:33 
Hi all,

I want to add String, long value pair in a map. I've done it as follows.

<br />
	string user_key[5] = {"cocacola", "pepsi", "cocacola", "mango", "pepsi"};<br />
	unsigned long comm_val[5] = {25, 45, 24, 67, 98};<br />
	<br />
	map<const string, unsigned long>	comm_map; // map to store data<br />
	map<const string, unsigned long>::const_iterator iter;<br />
<br />
	// Store data<br />
	for(int i = 0; i < 5; i++)<br />
	{<br />
		iter = comm_map.find(user_key[i]);<br />
<br />
		if(iter == comm_map.end())<br />
		{<br />
			// not found<br />
			comm_map.insert(pair<const unsigned="" long="">(user_key[i], comm_val[i]));<br />
		}<br />
		else<br />
		{<br />
			// found<br />
			comm_map[user_key[i]] = comm_val[i];<br />
		}		<br />
	}<br />
</const>


Actually in my application, this map updated around every 30 milliseconds. I mean every 30 milliseconds data is send to the map. It's fine so far.

But what I need to do is, regularly I want to send map content to a XML file. My question is, at the XML write time I want to stop updating the map. Otherwise data can be loss or some other effect. How can I avoid this? Using a flag?

Any comments,
Thanks Smile | :)

I appreciate your help all the time...
CodingLover Smile | :)

AnswerRe: Updating and retrieving data from a map. Pin
Nishad S10-Nov-08 20:04
Nishad S10-Nov-08 20:04 
NewsRe: Updating and retrieving data from a map. Pin
CodingLover10-Nov-08 21:17
CodingLover10-Nov-08 21:17 
GeneralRe: Updating and retrieving data from a map. Pin
Nishad S10-Nov-08 21:55
Nishad S10-Nov-08 21:55 
QuestionHow to maintain a Bit Array Pin
h@$@n10-Nov-08 18:18
h@$@n10-Nov-08 18:18 
AnswerRe: How to maintain a Bit Array Pin
Randor 10-Nov-08 19:08
professional Randor 10-Nov-08 19:08 
GeneralRe: How to maintain a Bit Array Pin
h@$@n10-Nov-08 21:07
h@$@n10-Nov-08 21:07 
Questionhow to programmatically select and unselect a radio button ? Pin
kapardhi10-Nov-08 18:01
kapardhi10-Nov-08 18:01 
AnswerRe: how to programmatically select and unselect a radio button ? Pin
_AnsHUMAN_ 10-Nov-08 18:09
_AnsHUMAN_ 10-Nov-08 18:09 
GeneralRe: how to programmatically select and unselect a radio button ? Pin
kapardhi10-Nov-08 18:24
kapardhi10-Nov-08 18:24 
GeneralRe: how to programmatically select and unselect a radio button ? Pin
_AnsHUMAN_ 10-Nov-08 18:29
_AnsHUMAN_ 10-Nov-08 18:29 
Questionhow to get running process list of Windows XP Pin
vijay.victory10-Nov-08 17:54
vijay.victory10-Nov-08 17:54 
AnswerRe: how to get running process list of Windows XP Pin
_AnsHUMAN_ 10-Nov-08 18:15
_AnsHUMAN_ 10-Nov-08 18:15 
GeneralRe: how to get running process list of Windows XP Pin
vijay.victory10-Nov-08 18:39
vijay.victory10-Nov-08 18:39 
GeneralRe: how to get running process list of Windows XP Pin
_AnsHUMAN_ 10-Nov-08 18:45
_AnsHUMAN_ 10-Nov-08 18:45 
GeneralRe: how to get running process list of Windows XP Pin
vijay.victory10-Nov-08 19:40
vijay.victory10-Nov-08 19:40 
GeneralRe: how to get running process list of Windows XP Pin
_AnsHUMAN_ 10-Nov-08 19:45
_AnsHUMAN_ 10-Nov-08 19:45 
GeneralRe: how to get running process list of Windows XP Pin
vijay.victory10-Nov-08 20:11
vijay.victory10-Nov-08 20:11 

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.