Hello Bryan,
First of all, thank you for buying the book. I really hope you are enjoying it so far, and sorry about the problems you're experiencing.
For the first issue, somehow the type definitions didn't get updated along with the rest of the code. You don't want to use unordered_map for the GUI_Interfaces container type. Instead, you could simply switch to std::map, or try something that looks like this:
using GUI_InterfaceType = std::pair<std::string, std::unique_ptr<GUI_Interface>>; // Smart pointer or raw, doesn't matter.
using GUI_Interfaces = std::vector<GUI_InterfaceType>; // Vector DOES support reverse iterators.
using GUI_Container = std::unordered_map<StateType, GUI_Interfaces>;
std::map would be an easier switch. Obviously some GUI code might have to change a little bit, because of the way information is accessed if it's a vector. I will try to contact Packt and get this fixed, as it should have been updated in the final product.
The second issue you're experiencing simply has to do with the encoding of your project. Your IDE is set to use wide characters, so instead of the char type you could simply use wchar_t, or you could re-work the function like this (use the 'A' suffix for two functions):
inline std::string GetWorkingDirectory() {
HMODULE hModule = GetModuleHandle(0);
if (hModule) {
char path[256];
GetModuleFileNameA(hModule, path, sizeof(path));
PathRemoveFileSpecA(path);
strcat_s(path, "\\");
return std::string(path);
}
return "";
}
I would recommend the former, but it's your call. More information on that can be found here:
http://www.cplusplus.com/forum/windows/185258/