[Prev][Next][Index][Thread]
Re: RegisterClass problem
-
To: "Eman Fu" <EmanFu@acer.com.tw>
-
Subject: Re: RegisterClass problem
-
From: Henrik Frystyk Nielsen <frystyk@w3.org>
-
Date: Tue, 23 Jan 1996 18:21:00 -0500
-
Cc: www-lib@w3.org
-
From frystyk@w3.org Tue Jan 23 18: 21:14 1996
-
Message-Id: <9601232321.AA05553@www20>
-
Reply-To: Henrik Frystyk Nielsen <frystyk@w3.org>
-
X-Mailer: exmh version 1.6.2 7/18/95
"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