Can't get my Delphi written DLL to register its class!?

I've been stuck on this damned thing for a couple of weeks!

I've written a 32-bit DLL that works in most situations except
for that for which it was written -- as a support for Asymetrix Toolbook.

In the setup code for the DLL, see below, is a request to register a window
class. In the context of Toolbook this request fails. In all other tested
situations there is no trouble.

Does anyone know under what conditions RegisterClass will fail? I thought
maybe there was a conflict in the name of the window class I was trying to
register, so I changed the name a few times and still no improvement.

How can something that registers a window work under most conditions but
under the one it was written for it doesn't?!?

const

  MCIName = 'CallbackWindow';

function registerCls: boolean;
const
  MCIWindowClass: TWndClass = (
    style: 0;
    lpfnWndProc: @MCIWindowProc;
    cbClsExtra: 0;
    cbWndExtra: 0;
    hInstance: 0;
    hIcon: 0;
    hCursor: 0;
    hbrBackground: 0;
    lpszMenuName: '';
    lpszClassName: MciName);
begin

  MCIWindowClass.hIcon := 0;
  MCIWindowClass.hCursor := LoadCursor(0, idc_Arrow);
  MCIWindowClass.hbrBackground := GetStockObject(white_Brush);
  if RegisterClass(MCIWindowClass) = 0 then
    registerCls := false
  else
    registerCls := true;
end;

begin

  if RegisterCls = false then
  begin
    messagebox(0,'Register Class failed','Error',0);
    Halt(255);
  end;

end.

----------------------------------------------------

Ian

Everything but the SPAM in the email address is ok.
------------------------------------------------------

If I knew where I was going, I'd probably be scared.