I noticed this line:
cpp
LPCWSTR lpString = "Random String"; // character string
LPCWSTR is essentially defined to be const wchar_t* (or perhaps something else with the same result).
You could give a wchar_t* literal, by using the L prefix:
LPCWSTR lpString = L"Random String";
However, this is not the recommended way of doing it. It's usually better to do:
LPCTSTR lpString = _T("Random String");
(Make sure tchar.h is included).
This is because there's a seperate API for char* strings and for wchar_t* strings (UTF-16LE). Writing your code
like this will allow you to compile your program to use char* or wchar_t* just by defining or undefining a preprocessor symbol. If you look up the definition of TextOut on MSDN, you'll notice that it takes in a LPCTSTR parameter, so you don't need to change anything about the call to take advantage of this.
Also, your string is not 15 characters, but 13. I know that this is a test program, but you can free yourself from having to manually calculate the string length...
Instead of the above, do something more like this:
cpp
TCHAR lpString[] = _T("Random String");
// Subtracting 1 for the null terminator
int cbString = (sizeof(lpString) / sizeof(lpString[0])) - 1;
That's all for now.