Subject: bug#8562: Emacs 23.1 and later don't work in windows 98

From: oslsachem <[email-masked]>
Date: Tue, 31 May 2011 20:16:00 +0200

> The safest place is the same directory where you have emacs.exe.  But
> doing what you did is also OK.

I tried putting the unicows.dll there too and adding that directory to
the path but I still got the same error (120)

> The difference here is that your sample program dynamically loads
> unicows.dll:
>
>> Breakpoint 1, WinMain (hInstance=0x400000, hPrevInstance=0x0,
>>     lpCmdLine=0x81631ea2 "", nCmdShow=10) at sample.c:139
>> 139     hm_unicows = LoadLibrary("unicows.dll");
>
> whereas Emacs doesn't, AFAICT.

I haven't found any reference to the word unicows in the source files.
I suspect Emacs is not aware of the availability of the MSLU library
for windows 98, by reading this comment (which I found while searching
for the word unicode) from w32font.c:510

---------------------------------------------------------------------------------------------------------------------------------
  if (GetTextExtentPoint32W (dc, wcode, nglyphs, &size))
    {
      total_width = size.cx;
    }

  /* On 95/98/ME, only some unicode functions are available, so fallback
     on doing a dummy draw to find the total width.  */
  if (!total_width)
    {
      RECT rect;
      rect.top = 0; rect.bottom = font->height; rect.left = 0; rect.right = 1;
      DrawTextW (dc, wcode, nglyphs, &rect,
                 DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
      total_width = rect.right;
    }
----------------------------------------------------------------------------------------------------------------------------------

DrawTextW is a unicode function which is available (from User32.dll)

http://www.speedyshare.com/files/28740563/BrowsingUser32.png

But GetTextExtentPoint32W is a unicode function which is available too
(from unicows.dll)

http://www.speedyshare.com/files/28740564/BrowsingUnicows.png

>  Could you try loading that DLL in
> Emacs, by adding just the single line as the one above to some
> function that is run early during the startup, e.g. in globals_of_w32?
> (There's no need to go to extra lengths such as calling
> GetOutlineTextMetricsW and GetTextMetricsW through function pointers.)
> Then recompile Emacs and see if that solves the problem.

I see the same error (120)

http://www.speedyshare.com/files/28740565/Emacs-23.3GDBglobals.txt

Greetings,
                  Osl