Problem with windows types

I've only just started windows programming so this may be a stupid question but I'm having problems when creating windows. The following line:
wc.lpszClassName = g_szClassName;
Generates the following error:
error C2440: '=' : cannot convert from 'const char *[]' to 'LPCWSTR'

I understand the error type, I've seen it before when I've made mistakes. I was under the impression that LPCWSTR was just the windows name for a pointer to a constant string.

Any help you can provide would be useful.

Thanks in advance.
Last edited on
closed account (z05DSL3A)
LPCWSTR is pointer to a constant null-terminated string of 16-bit Unicode characters. (the important thing is the W for wide).

Read up on TCHAR and the TEXT macro
1
2
3
static TCHAR szAppName[] = TEXT ("HelloWin") ;
...
wndclass.lpszClassName = szAppName ;


http://msdn.microsoft.com/en-us/library/c426s321(VS.80).aspx
Last edited on
Topic archived. No new replies allowed.