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

Re: RegisterClass problem

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 23 Jan 1996 18:21:00 -0500
Message-Id: <9601232321.AA05553@www20>
To: "Eman Fu" <EmanFu@acer.com.tw>
Cc: www-lib@w3.org
"Eman Fu" writes:

> 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.

This is most useful information! The GP problem is well-known - also on Unix 
and should hopefully not be the case in too many places. If you have some 
patches that you would like to share - then hat would be very nice!

Thanks a lot!


-- 

Henrik Frystyk Nielsen, <frystyk@w3.org>
World-Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA
Received on Tuesday, 23 January 1996 18:21:14 GMT

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