W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1996

Re: RegisterClass problem

From: Eman Fu <EmanFu@acer.com.tw>
Date: Sun Jan 21 20:55:07 1996
Message-Id: <9600228223.AA822333426@acer.com.tw>
To: www-lib@w3.org
Cc: EmanFu@acer.com.tw
     
>But I would like to use it under Windows for Workgroup. I have installed 
>win32s release 1.30.159.0. I run my application but it doesn't work 
>correctly. I obtain this message in my tracefile :
>
>WWWLibInit.. INITIALIZING LIBRARY OF COMMON CODE
>HTEvent_Loop.. Can't RegisterClass "AsyncWindowClass"
>
>My application exits of HTLibInit without executing WSAStatup. That's why when 
>the libwww attempts to execute the socket function, I receive an error message.
>
>Has anyone already noticed this problem ?
>Does anyone have a idea to solve this problem ?

Yes! I have encounterred such a problem, too. I noticed that the value passed to
the field hInstance of the structure WNDCLASS, which is the parameter of 
RegisterClass, is got by GetCurrentProcess() function. But as my experiments, 
the value got from GetCurrentProcess() is not the same as the real instance 
handle passed into WinMain(), thus failed the RegisterClass() call. I changed 
the code to use the real instance handle, then everything got fixed. You can try
it!

I also found that in several places there are such codes:

   if (some_pointer->some_field) {
       //...operations on some_pointer->some_field...
       ...
   }

The codes caused GP Fault in Windows if some_pointer is NULL. I also added 
checks on some_pointers to ensure they are not NULL. Hope my experience 
will help you.

Best regards,

Eman Fu
EmanFu@acer.com.tw
Received on Sunday, 21 January 1996 20:55:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:25 GMT