Up front - 1st post and preview doesn't seem to work, and hope code tags do,
Hope this is not too basic a question, but how does Windows communicate an integer to a user? Converting to a std::string is not hard, but from there, it seems impossible to use an API function to output the string to the window. MessageBox does not seem to be the answer. Just want an informative message to the user here. Any help would be appreciated. I'm kind of new to the API. Thanks!
MessageBox(hWnd, _T("Load of type DATA FAILED"), lpCaption,
MB_OK | MB_ICONINFORMATION);
// tried this
// int ends up in "result", but "result" can't be used anywhere (so far)
// tconvert << g_data->datacount; //ostringstream
// result = tconvert.str(); //normally std::string
// just hardcode it for now
TCHAR result = _T("?? records were loaded.");
MessageBox(hWnd, result , lpCaption, MB_OK | MB_ICONINFORMATION);
In your commented-out code, is result supposed to be a std::string, or what?
Adding to what salem c said, if your TCHAR is the "wide" char, then you want to use std::wstring.
You could do a fancy sort of typedef to get a "tstring" type, something like: using tstring = std::basic_string<TCHAR>;
But it might be better to just stick with Windows "unicode".
Edit: Oh wow, I didn't realize I was just repeating what was in salem c's link.
One caveat: You should not put anything into the std namespace yourself. That is reserved. It might not break. But you shouldn't do it.
Being totally new to Windows and somewhat new to C++
Avoid for now using the Windows API as if it were the plague, IMO. I'd advice getting comfortable with "straight" C++ first.
The Windows API can be very intimidating for someone without a good C/C++ programming base.
Even with a good understanding of C/C++ Windows can be intimidating.
MS keeps changing the API, making a lot of online resources about how to do Windows API programming have problems.
The "Bible" of C-based Win32 programming, Charles Petzold's "Programming Windows, Fifth Edition", published 1999, needs some tweaks to the included source code to work with the current Windows API.
There are a couple of good online C++ tutorials I'd recommend. The one here at CPlusPlus ( http://www.www.diovzgy.cn/doc/tutorial/ ) hasn't been updated in years. Still good for learning the basics of the C++ core.