Okay, my program is now setup to support both Unicode & Non-unicode. (only took a few minutes.. nice! No hassle at all)
Anyways I still have a few questions:
1) Ex:
Code:
typedef std::basic_string<TCHAR> UnicodeString;
UnicodeString name = TEXT("Bob");
name.c_str();
.c_str() I did not find this located in documentation. What is it doing exactly? Just returning a char* or wchar_t* from my String object depending on whether Unicode is set or not?
2) I'm now getting a WinMain function cannot be overloaded error. What is the correct definition under UNICODE? Below is what I am trying to use:
Code:
int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPTSTR cmdLine, int cmdShow);
3)
Code:
handleDrag = (handleDragFunction)GetProcAddress((HMODULE)gameLibInst, TEXT("handleDrag"));
gives this error:
Code:
error C2664: 'GetProcAddress' : cannot convert parameter 2 from 'const wchar_t [11]' to 'LPCSTR'
? Hmm... why is GetProcAddress not a UNICODE function? (Note: If remove TEXT() from 2nd param it works)
4) The <tchar.h> header... why do I need to include this? Is it required for TEXT macro and stuff? If so, my program uses the TEXT macro without having to include this file, am I to assume my compiler is automatically including this when set to UNICODE character set? (MSVC 2005 Express Edition)
Edit: For question 2 on entry points replacing WinMain() with wWinMain() seems to work, but now would my program be ANSI compatible? Why does WinMain() not work like other functions where depending on the character set the appropriate function is called through typedefs? (either WinMain() or wWinMain())