I'm trying to create a map of function names and function pointers using __stdcall. Here is how I currently get my function pointers:
typedef int (CALLBACK* InitializeDLL)(int,int);
InitializeDLL initializeDLL = (InitializeDLL)GetProcAddress(hInstanceLibrary, "InitializeDLL");
and now my Map:
map<string, int *__stdcall> mapInt;
mapInt["InitializeDLL"] = initializeDLL; //throws error for "InitializeDLL cannot be assigned to entity of type int*"
That error is exactly what I expected, but I need to add a type apparently in front of __stdcall. If I remove the "int" in the front then it complains with:
Error: expected a type specifier
If I try to compile it after only creating the map object with the "int" included in the front, it throws the error:
error C2059: syntax error : '>'
Which does not make much sense to me. So what is the correct way to use __stdcall as a type for a map? Adding the int in front of it seemed suspicious to me, but if I don't add it then it complains that it needs a type specified.
Also, CALLBACK is a #define for __stdcall if that is confusing.