Get rid of W->A calls

Robert Shearman R.J.Shearman at warwick.ac.uk
Fri Sep 5 12:16:29 CDT 2003


> -----Original Message-----
> From: wine-devel-admin at winehq.org [mailto:wine-devel-admin at winehq.org]On
> Behalf Of Dimitrie O. Paun
> Sent: 05 September 2003 17:40
> To: hatky at users.sourceforge.net
> Cc: wine-devel at winehq.org
> Subject: Re: Get rid of W->A calls
>
> > why did they call them wcommand in WinHelpA and
> > command in WinHelpW ?? (msdn calls them uCommand but
> > the code uses wcommand...)
>
> I don't see why, it should be named the same in
> both versions if it's encoding independent.

I think the confusing thing is the 'w' prefix. In this case 'w' stands for
WORD, i.e. a two-byte integer. Also, MSDN isn't clear as to whether it is
encoding independent but I would assume so.

> > -hDest = FindWindowA("MS_WINHELP", NULL);
> > +hDest = FindWindowW("MS_WINHELP", NULL);
>
> You can't to that directly, as we don't support
> Unicode literals. You need to do that by hand:
>
>     WCHAR clsName[] = { 'M', 'S', '_', 'W', 'I', 'N', 'H', 'E',
> 'L', 'P', 0 };
>     hDest = FindWindowW(clsName, NULL);
>

This would be better:

static const WCHAR clsName[]...

It allows for better optimization by the compiler (assuming that the
compiler can't work out that clsName will not be modified) and shows the
purpose better to the next person who looks at it.

Rob





More information about the wine-devel mailing list