This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Re: GetDC(NULL), GetModuleHandle(NULL), etc.
- From: Alexander Gottwald <alexander dot gottwald at s1999 dot tu-chemnitz dot de>
- To: cygwin-xfree at cygwin dot com
- Date: Sun, 4 Sep 2005 13:52:19 +0200 (MEST)
- Subject: Re: GetDC(NULL), GetModuleHandle(NULL), etc.
- References: <4318DD2B.5010805@nc.rr.com>
- Reply-to: cygwin-xfree at cygwin dot com
On Fri, 2 Sep 2005, Joe Krahn wrote:
> GetModuleHandle(NULL) is also in several places. Maybe it's OK, but why
> not use the hInstance global?
Global variables are bad(TM). With GetModuleHandle(NULL) there is no need
to maintain a global hInstance. The other reason is there is no WinMain
which has the hInstance parameter. So you'd require to set the global
hInstance somewhere else and you have to make sure this occurs before
the first reference to hInstance. GetModuleHandle(NULL) was used explicitly
to reduce complexity.
bye
ago
--
Alexander.Gottwald@s1999.tu-chemnitz.de
http://www.gotti.org ICQ: 126018723
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/