-
January 12th, 2009, 10:41 AM
#1
'WM_UNICHAR' was not declared in this scope
hi, im using one of the latest GCC and it surprise me WM_UNICHAR is not defined.
im using WIN32_LEAN_AND_MEAN but i do not think it has anything todo with that, since i coulndt find the definition of WM_UNICHAR anywhere in the winuser.h
can anyone help me ?
Last edited by cj-wijtmans; January 12th, 2009 at 10:52 AM.
-
January 12th, 2009, 10:50 AM
#2
Re: 'WM_UNICHAR' was not declared in this scope
MSDN says:
Declared in Winuser.h, include Windows.h
But it also appears that you have to target your application fror 5.1 (XP) minimum:
#if(_WIN32_WINNT >= 0x0501)
#define WM_UNICHAR 0x0109
.....
-
January 12th, 2009, 10:53 AM
#3
Re: 'WM_UNICHAR' was not declared in this scope
ooh yeah i dint find it in winuser.h either.
also is there no way to use unicode WM_CHAR on lower systems than XP?
-
January 12th, 2009, 11:01 AM
#4
Re: 'WM_UNICHAR' was not declared in this scope
allso what is UNICODE_NOCHAR?
these GCC headers dont seem complete!
-
January 12th, 2009, 12:40 PM
#5
Re: 'WM_UNICHAR' was not declared in this scope
Originally Posted by cj-wijtmans
ooh yeah i dint find it in winuser.h either.
also is there no way to use unicode WM_CHAR on lower systems than XP?
You may have pre-XP header files. The usual thing to do in this case is to download the latest SDK from Microsoft.
I don't know enough about WM_UNICHAR to speak authoritatively, but based on the documentation I would guess that the message is simply not implemented in pre-XP operating systems.
Sorry, UNICODE_NOCHAR is a bit of a mystery to me. There's only one reference to it on MSDN (in a blog post) and I don't have time to sort through the Google results.
-
January 12th, 2009, 01:36 PM
#6
Re: 'WM_UNICHAR' was not declared in this scope
my headers are not pre-xp
-
January 12th, 2009, 01:46 PM
#7
Re: 'WM_UNICHAR' was not declared in this scope
I don't know what to tell you. I have Windows Server 2003 R2 SDK and it's defined in winuser.h just like I showed above. Do you know which SDK you are using?
-
January 12th, 2009, 03:23 PM
#8
Re: 'WM_UNICHAR' was not declared in this scope
-
January 12th, 2009, 04:53 PM
#9
Re: 'WM_UNICHAR' was not declared in this scope
I admit that I know nothing about gcc, but Microsoft is the only official source for Windows headers.
-
January 12th, 2009, 05:04 PM
#10
Re: 'WM_UNICHAR' was not declared in this scope
and you are sure that windows headers will work with GCC? i think they are designed for VC++ only.
-
January 12th, 2009, 05:27 PM
#11
Re: 'WM_UNICHAR' was not declared in this scope
As I said, I know nothing of gcc, but if it can create Windows applications then I would assume that it can use Microsoft's headers. And I can tell you that if gcc supplies Windows headers then they must originate with Microsoft. They are redistributable after all. Of course, gcc could modify them for its own purposes but I'm not sure that would pass a license test.
Why are you positive that your headers are post-XP? It sound to me like they aren't. Just because you acquire something after XP has been released doesn't mean that it is XP compatible. gcc could be supplying very old headers.
Another thing to consider is that maybe in your case you could just define WM_UNICHAR yourself as show above (0x109). You must realize that the definition in the header is only for the benefit of your program. Any post-XP operating system will send the WM_UNICHAR message regardless of whether your program knows about it. If that message is the only thing you are missing then just define it and see what happens.
There's always the chance that the number I provided will be incompatible in the future, but I've never seen any indication that once a Windows message has been defined that it ever gets changed.
-
January 12th, 2009, 05:39 PM
#12
Re: 'WM_UNICHAR' was not declared in this scope
because my headers include vista functions
-
January 12th, 2009, 05:43 PM
#13
Re: 'WM_UNICHAR' was not declared in this scope
You may still want to consider my advice about defining WM_UNICHAR yourself, but I know that many here also use gcc. Does anyone else have an idea of what is happening? Why don't the gcc headers define this message?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|