Get rid of W->A calls

hatky hatkyinc at yahoo.com
Fri Sep 5 12:27:08 CDT 2003


> OK, I have to warn you I haven't looked at the code,
> so I'll just go by what I see in this email.
That's what I was expecting so I checked it carfully
and copied what seems to mater + I know that if/when I
will submit the patch it will be checked more...

> > 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.
So should I make it uCommand as in msdn or leave it
wcommand?


> 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);
Ok, I get this but why don't we support Unicode
literals? seems like it makes the code a mess and
there will be another task to clean that up
sometime...

> Ditto, just do
>         if (!(hDest = FindWindowW(clsName, NULL);
No problem.

> OK.
I got 1 right :) yepi. 

> > and now I need to put a call in WinHelpA to
> WinHelpW
> > after converting 
> > LPCSTR lpHelpFile
> > ?
> 
> Yes.
And the code goes like this:?
    INT len;
    LPSTR file;
    BOOL ret = FALSE;

    if (!lphelpFile) return WinHelpW( hWnd, NULL,
command, dwData );

    len = MultiByteToWideChar( CP_ACP, 0, helpFile,
-1, NULL, 0, NULL, NULL );
    if ((file = HeapAlloc( GetProcessHeap(), 0, len
)))
    {
        MultiByteToWideChar( CP_ACP, 0, helpFile, -1,
file, len, NULL, NULL );
        ret = WinHelpW( hWnd, file, command, dwData );
        HeapFree( GetProcessHeap(), 0, file );
    }
    return ret;



Wait, if I change lpHelpFile to Unicode then I should
change also:

+#include "wine/unicode.h"
or should it be
+#include <unicode.h>?

-        nlen = strlen(lpHelpFile) + 1;
+        nlen = strlenW(lpHelpFile) + 1;

-        strcpy(((char*)lpwh) + sizeof(WINHELP),
lpHelpFile);
+        strcpyW(((char*)lpwh) + sizeof(WINHELP),
lpHelpFile);

and I assume 
    if (lpHelpFile)
is still ok, right?

hatky.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the wine-devel mailing list