Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
iam porting a c++ software in c# what is CMapStringToString equal in c#

Thanks in advance

What I have tried:

CMapStringToString FileExistsMap;

FileExistsMap.SetAt(_T("Abc"),_T("developer"));
FileExistsMap.SetAt(_T("Abc"),_T("developer"));
FileExistsMap.SetAt(_T("Abc"),_T("developer"));
CString foundvalue;
FileExistsMap.Lookup(_T("Abc"),foundvalue);
Posted
Updated 28-Jun-17 21:16pm

1 solution

Corrected version: As CMapStringToString accepts duplicate keys, this could easily be implemented as a List<KeyValuePair<string, string>>. It could also be a Tuple, but in this case, the list would be a fine choice.
 
Share this answer
 
v2
Comments
srilekhamenon 29-Jun-17 3:19am    
Sir Dictionary do not accept duplicate keys but CMapStringToString accepts duplicate key so how can we use Dictionary ?
Pete O'Hanlon 29-Jun-17 3:20am    
A dictionary doesn't accept duplicate keys. Where did you get that idea?
srilekhamenon 29-Jun-17 3:23am    
yes sir i want the structure which accept duplicate keys :)
Pete O'Hanlon 29-Jun-17 3:30am    
Ah, I see. In that case, simply use a List<KeyValuePair<string, string>>
srilekhamenon 29-Jun-17 3:41am    
thankyou sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900