Is there perhaps a better way to do this besides changing the name scheme (e.g. You are better off writing your library so that there are no name clashes with MS's macro names. If you are careful about it, you can make it work, but these macros can change, their implementation can change depending on where MS wants to take their API in the future and what is behind them may change. Is it acceptable to undefine Windows API macros (e.g. If you want to create a library for future use with an intentional name clash, probably no. If you have the time to do that as an exercise, probably (there should be a lot of effort involved). I have not completed this but want to make my own template library for wrapping the Win32 API to make it compatible with std::string/std::wstring. ::GetWindowTextA(hWnd, buffer.data(), len) Įxample Usage std::basic_string text = GetWindowText(hWnd) Return std::basic_string(buffer.begin(), buffer.end()) ::GetWindowTextW(hWnd, buffer.data(), len) Std::size_t len = GetWindowTextLength(hWnd)+1 Template std::basic_string GetWindowText(HWND hWnd) Template int GetWindowTextLength(HWND hWnd) I prefer to deal directly with the Windows API I just want to make it easier to work with std::basic_string. Note: Please don't provide answers like "why don't you just use WTL?" or "just use MFC". getWindowText or GetWindowString as opposded to GetWindowText)? I prefer not to change the names. Is there perhaps a better way to do this besides changing the name scheme (e.g.Is it acceptable to undefine Windows API macros (e.g.Here's a sample of what I've worked with so far.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |