MFC equivalent for STL std::map

I need to associate strings to FILE pointers, and strings to unsigned long integers. Using the STL i would simply do :

map<string, FILE *>
map<string, unsigned long int>

But i don't understand how to do the equivalent with MFC CMap.

I tried :

CMap<string, string &, FILE *, FILE * &>
CMap<string, string *, FILE *, FILE **>

But i'm getting errors in both cases : error c2440 typecast cannot convert from std string to DWORD_PTR

Also i'm not sure to understand the logic of having 4 template parameters.

Can anyone explain me please ? Thank you.

Answers


CMap<string, FILE*>

and

CMap<string, unsigned long>

should work fine. The version using 4 parameters is for specialized scenarios only.


Need Your Help

HttpClient Get https C# NetworkCredentials not working

java c# rest https

I don't know how to do a GET to a REST web service through HTTPS with C#. I know how to do it in Java, but how to get the same behavior of the below code using c#?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.