In C++ I have defined a class that has this as a member:
static const std::basic_string<TCHAR> MyClass_;
There is also a getter function for this value:
LPCTSTR CClass::GetMyClassName()
{
return MyClass_.c_str();
}
When I create an instance of this class and then try and access it intellisense pops up but the name has been changed depending on whether the project has been compiled for Unicode or Multibyte. If it has been compiled for Unicode the function appears as:
aClass.GetMyClassNameW();
else it is:
aClass.GetMyClassNameA();
What I'd like to know is how is the name getting changed? Also I would like to know is it possible for intellisense to show the correct name of the function? So that I can access it like this:
aClass.GetMyClassName()
EDIT: The precise member function name I've used in my code is:
WinClass::GetClassName()
Your method name is literally "GetMyClassName" or is it "GetClassName"?
GetClassName is in the SDK (winuser.h) and is redefined based on the UNICODE defines. If you are using "GetClassName" the intellisense is probably getting confused; in fact the compiler is generating the A/W suffix for the actual compiled method as well but that would all work because everyone (Linker/Compiler) agrees on the redefined name (even if its not visible).
Thats the windows way to support in fact 2 versions of the Win32 API:
char
)wchar
)If you look into i.e.
winuser.h
, you'll see the following:I cant exactly tell why the same happens to your function GetMyClassName. But it pobably has the same reason.